4#ifndef SWIG__COMMON__NDS_CHANNEL_HH
5#define SWIG__COMMON__NDS_CHANNEL_HH
24 inline namespace abi_0
71 class hash_type :
private std::vector< unsigned char >
76 using element_type::size;
80 bool compare(
const void* Buffer,
81 size_t Length = (
size_t )( -1 ) )
const;
83 const void*
ref( )
const;
303 return ( ( size( ) > 0 ) ? &( this->
operator[]( 0 ) ) :
zero_hash );
306 inline const std::string&
371 inline const std::string&
380 static const std::string STREND_EXT(
",s-trend" );
382 if (
Name.size( ) <= STREND_EXT.size( ) )
386 return ( STREND_EXT.compare(
Name.substr(
387 Name.size( ) - STREND_EXT.size( ) ) ) == 0 );
393 static const std::string MTREND_EXT(
",m-trend" );
395 if (
Name.size( ) <= MTREND_EXT.size( ) )
399 return ( MTREND_EXT.compare(
Name.substr(
400 Name.size( ) - MTREND_EXT.size( ) ) ) == 0 );
424 template <
typename T >
427 static const NDS::channel::data_type value =
428 NDS::channel::DATA_TYPE_UNKNOWN;
434 static const NDS::channel::data_type value =
435 NDS::channel::DATA_TYPE_INT16;
441 static const NDS::channel::data_type value =
442 NDS::channel::DATA_TYPE_INT32;
448 static const NDS::channel::data_type value =
449 NDS::channel::DATA_TYPE_INT64;
455 static const NDS::channel::data_type value =
456 ( NDS::channel::DATA_TYPE_FLOAT32 );
462 static const NDS::channel::data_type value =
463 NDS::channel::DATA_TYPE_FLOAT64;
469 static const NDS::channel::data_type value =
470 ( NDS::channel::DATA_TYPE_COMPLEX32 );
476 static const NDS::channel::data_type value =
477 NDS::channel::DATA_TYPE_UINT32;
#define DLL_EXPORT
Definition channel.h:12
The hash_type represents a channel hash. The channel hash is an hash of the NDS2 channel list....
Definition nds_channel.hh:72
static const unsigned char zero_hash[1]
Definition nds_channel.hh:90
std::vector< unsigned char > element_type
Definition nds_channel.hh:74
static const size_t MAX_SIZE
Definition nds_channel.hh:91
const void * ref() const
Definition nds_channel.hh:301
hash_type()
Definition nds_channel.cc:27
void reset()
Definition nds_channel.cc:42
bool compare(const void *Buffer, size_t Length=(size_t)(-1)) const
Definition nds_channel.cc:33
Represents a LIGO data channel.
Definition nds_channel.hh:34
static DLL_EXPORT bool IsMinuteTrend(const std::string &Name)
Check the channel name to see if it is a minute trend.
Definition nds_channel.hh:391
static DLL_EXPORT const channel_type DEFAULT_CHANNEL_MASK
The combination of all valid channel types.
Definition nds_channel.hh:109
static DLL_EXPORT const sample_rate_type MIN_SAMPLE_RATE
Smallest sample rate possible.
Definition nds_channel.hh:124
signal_gain_type gain
Definition nds_channel.hh:292
double sample_rate_type
Defines the sample rate type.
Definition nds_channel.hh:94
sample_rate_type sample_rate
Definition nds_channel.hh:291
signal_slope_type slope
Definition nds_channel.hh:293
channel_type type
Definition nds_channel.hh:289
float signal_offset_type
Defines the offset type.
Definition nds_channel.hh:97
DLL_EXPORT signal_offset_type Offset() const
Return the offset of the channel.
Definition nds_channel.hh:366
DLL_EXPORT void swap(channel &Source)
Swap this channel with another.
Definition nds_channel.cc:272
std::string name
Definition nds_channel.hh:288
signal_offset_type offset
Definition nds_channel.hh:294
DLL_EXPORT const std::string & Units() const
Return the units of this channel.
Definition nds_channel.hh:372
static DLL_EXPORT const std::string & ToString(channel_type ChannelType)
Return a string representatino of the given channel_type.
Definition nds_channel.cc:82
static DLL_EXPORT data_type convert_daq_datatype(int DataType)
Convert from the legacy daqd data types to a data_type enum.
Definition nds_channel.cc:227
std::string units
Definition nds_channel.hh:295
static DLL_EXPORT const sample_rate_type MAX_SAMPLE_RATE
Largest sample rate possible.
Definition nds_channel.hh:126
DLL_EXPORT size_type DataTypeSize() const
Return the size in bytes of an individual sample from the channel.
Definition nds_channel.hh:325
DLL_EXPORT channel_type Type() const
Return the type of the channel.
Definition nds_channel.hh:313
DLL_EXPORT const std::string & Name() const
Return the channel name.
Definition nds_channel.hh:307
DLL_EXPORT signal_gain_type Gain() const
Return the gain of the channel.
Definition nds_channel.hh:354
static DLL_EXPORT bool IsSecondTrend(const std::string &Name)
Check the channel name to see if it is a second trend.
Definition nds_channel.hh:378
float signal_gain_type
Defines the gain type.
Definition nds_channel.hh:95
channel_type
Definition nds_channel.hh:39
@ CHANNEL_TYPE_STATIC
Static data.
Definition nds_channel.hh:47
@ CHANNEL_TYPE_MTREND
Minute trend.
Definition nds_channel.hh:45
@ CHANNEL_TYPE_TEST_POINT
Test point data.
Definition nds_channel.hh:46
@ CHANNEL_TYPE_RDS
Reduced data set.
Definition nds_channel.hh:43
@ CHANNEL_TYPE_STREND
Second trend.
Definition nds_channel.hh:44
@ CHANNEL_TYPE_ONLINE
Online channel.
Definition nds_channel.hh:41
@ CHANNEL_TYPE_UNKNOWN
Unknown.
Definition nds_channel.hh:40
@ CHANNEL_TYPE_RAW
Raw channel.
Definition nds_channel.hh:42
data_type data
Definition nds_channel.hh:290
DLL_EXPORT channel()
Default constructor.
Definition nds_channel.cc:49
DLL_EXPORT data_type DataType() const
Return the data type of the channel.
Definition nds_channel.hh:319
DLL_EXPORT sample_rate_type SampleRate() const
Return the sample rate of the channel.
Definition nds_channel.hh:348
static DLL_EXPORT const data_type DEFAULT_DATA_MASK
The combinatino of all valid data types.
Definition nds_channel.hh:118
static DLL_EXPORT channel_type convert_daq_chantype(int ChanType)
Convert from the legacy daqd channel types to a channel_type enum.
Definition nds_channel.cc:194
std::vector< std::string > channel_names_type
A vector of channel names.
Definition nds_channel.hh:104
DLL_EXPORT channel(const channel &Source)
Copy constructor.
data_type
Defines the internal data representation.
Definition nds_channel.hh:53
@ DATA_TYPE_INT32
32 bit signed integer
Definition nds_channel.hh:56
@ DATA_TYPE_COMPLEX32
Complex value, two 32 bit floats.
Definition nds_channel.hh:60
@ DATA_TYPE_UNKNOWN
Unkown.
Definition nds_channel.hh:54
@ DATA_TYPE_FLOAT64
64 bit float value
Definition nds_channel.hh:59
@ DATA_TYPE_UINT32
32 bit unsigned integer value
Definition nds_channel.hh:62
@ DATA_TYPE_INT16
16 bit signed integer
Definition nds_channel.hh:55
@ DATA_TYPE_FLOAT32
32 bit float value
Definition nds_channel.hh:58
@ DATA_TYPE_INT64
64 bit signed integer
Definition nds_channel.hh:57
float signal_slope_type
Defines the slope type.
Definition nds_channel.hh:96
size_t size_type
Defines sizes when dealing with channels.
Definition nds_channel.hh:99
DLL_EXPORT signal_slope_type Slope() const
Return the slope of the channel.
Definition nds_channel.hh:360
DLL_EXPORT std::string NameLong() const
Return the name with additional information.
Definition nds_channel.cc:70
std::ostream & operator<<(std::ostream &os, const segment &obj)
Definition nds_availability.cc:72
std::vector< channel > channels_type
Definition nds_channel.hh:298
const std::string & channel_type_to_string(channel::channel_type ctype)
Definition nds_channel.cc:310
const std::string & data_type_to_string(channel::data_type dtype)
Definition nds_channel.cc:366
The NDS client namespace.
Definition debug_stream.cc:18
Given a C++ data type, determine which NDS channel data type applies to it.
Definition nds_channel.hh:426
Definition nds_connection_ptype.hh:149