#include <chan_list.hh>
Public Types | |
| enum | chan_type { kUnknown, kOnline, kRawData, kReduced, kSecondTrend, kMinuteTrend, kTypeCount } |
| enum | data_type { kByte1, kInt2, kInt4, kInt8, kReal4, kReal8, kComplex8, kComplex16 } |
| typedef unsigned long | source_count |
| Source count data type. | |
| typedef unsigned long | gps_type |
| GPS time data type. | |
Public Member Functions | |
| chan_entry (const std::string &name, chan_type type, long access=0, data_type dtype=kReal4, double rate=0, const std::string &source="") | |
| Channel constructor. | |
| void | addSource (const std::string &ftype) |
| Add a frame source. | |
| bool | available (gps_type t) const |
| Test for source availablility. | |
| long | getAccess (void) const |
| Get channel access level. | |
| data_type | dtype (void) const |
| int | data_size (void) const |
| const std::string & | name (void) const |
| Get channel name. | |
| source_count | getNSource (void) const |
| Number of sources. | |
| const std::string & | getSource (source_count inx=0) const |
| Get source string. | |
| chan_type | type (void) const |
| bool | is_source (const std::string &src) const |
| Test whether the channel exists in the specified source. | |
| void | merge (const chan_entry &ce) |
| merge source lists | |
| bool | operator< (const chan_entry &ent) const |
| Compare two channel entries. | |
| bool | operator== (const chan_entry &ent) const |
| Compare two channel entries. | |
| bool | operator!= (const chan_entry &ent) const |
| Compare two channel entries. | |
| double | rate (void) const |
| Sample rate. | |
Static Public Member Functions | |
| static data_type | getDataCode (const std::string &str) |
| Convert string to data type. | |
| static int | getDataSize (data_type type) |
| Get data type size. | |
| static std::string | getDataString (data_type type) |
| Convert data type to a string. | |
| static chan_type | getTypeCode (const std::string &str) |
| Convert string to channel type. | |
| static std::string | getTypeString (chan_type type) |
| Convert channel type to a string. | |
The channel list entry contains the channel name, data type, access code and a list of frame types that include the channel. The channel name and channel type are both needed to provide a unique identification of the channel because in some cases, the same channel name is used for both raw and decimated (RDS) data or for minute and second trends. The frame types are used to construct the frame names, e.g. "<site>-<type>-<gps>-<dt>.gwf". The initial implementation (2008.01.22) assumes that the frame lists do not change in time. It may become necessary to add a valid time range to each source data entry to reliably guide the channel source selection.
| typedef unsigned long sends::chan_entry::source_count |
Source count data type.
Data type used to represent the number of entries in the source list.
| typedef unsigned long sends::chan_entry::gps_type |
GPS time data type.
Data type used to reprepresent gps times.
Enumerate channel types.
Enumerate channel types.
| sends::chan_entry::chan_entry | ( | const std::string & | name, | |
| chan_type | type, | |||
| long | access = 0, |
|||
| data_type | dtype = kReal4, |
|||
| double | rate = 0, |
|||
| const std::string & | source = "" | |||
| ) |
Channel constructor.
Construct a channel entry.
| name | Full channel name. | |
| type | Type of channel | |
| access | Minumum level required to access this channel. | |
| dtype | Data type code. | |
| rate | Sample rate. | |
| source | Type code of frame containing the channel. |
| void sends::chan_entry::addSource | ( | const std::string & | ftype | ) |
Add a frame source.
Add a new source frame-type string. The source type string contains the site identifier and the frame type, separated by a hyphen, e.g. "H-R".
| ftype | Source type string. |
| bool sends::chan_entry::available | ( | gps_type | t | ) | const |
Test for source availablility.
Test whether the channel type isavailable at the specified time.
| t | Test time. @ |
| long sends::chan_entry::getAccess | ( | void | ) | const [inline] |
Get channel access level.
Get the access level required to reference this channel.
| data_type sends::chan_entry::dtype | ( | void | ) | const [inline] |
Get the data type code.
| int sends::chan_entry::data_size | ( | void | ) | const [inline] |
Get the data type code.
References getDataSize().
| static data_type sends::chan_entry::getDataCode | ( | const std::string & | str | ) | [static] |
Convert string to data type.
Convert from a data type string to the data_type code.
| str | Data type string. |
| runtime_error | if string is unknown. |
| static int sends::chan_entry::getDataSize | ( | data_type | type | ) | [static] |
Get data type size.
Get size in bytes of specified data element.
| type | Data type code. |
Referenced by data_size().
| static std::string sends::chan_entry::getDataString | ( | data_type | type | ) | [static] |
Convert data type to a string.
Convert a data_type code to a descriptive string.
| type | Data type to be converted. |
| const std::string& sends::chan_entry::name | ( | void | ) | const [inline] |
Get channel name.
Get a constant reference to the channel name string.
| chan_entry::source_count sends::chan_entry::getNSource | ( | void | ) | const [inline] |
Number of sources.
Get the number of source frame-types.
| const std::string & sends::chan_entry::getSource | ( | source_count | inx = 0 |
) | const [inline] |
Get source string.
Get a constant reference to the i'th source frame type string.
| inx | Index into the source list. |
| chan_type sends::chan_entry::type | ( | void | ) | const [inline] |
Get the channel type code.
| static chan_type sends::chan_entry::getTypeCode | ( | const std::string & | str | ) | [static] |
Convert string to channel type.
Convert from a channel type string to the chan_type code.
| str | Channel type string. |
| runtime_error | if string is unknown. |
| static std::string sends::chan_entry::getTypeString | ( | chan_type | type | ) | [static] |
Convert channel type to a string.
Convert a chan_type code to a descriptive string.
| type | Channel type to be converted. |
| bool sends::chan_entry::is_source | ( | const std::string & | src | ) | const |
Test whether the channel exists in the specified source.
See if channel is available in the named frame type. Note that if the variation of the channel content of the frame types with time is to be supported, this function will have to add a time argument.
| src | Source name to be tested. |
| void sends::chan_entry::merge | ( | const chan_entry & | ce | ) |
merge source lists
Merge source list from the argument entry into this entry. This method is implemented by looping over the entries in the argument list and using the addSource method to add in sources one at a time. Although this is hideously inefficient, I expect that the source list will never become more than 2-3 entries long and will only be modified at start-time.
| ce | Channelentry containing list to be merged. |
| bool sends::chan_entry::operator< | ( | const chan_entry & | ent | ) | const [inline] |
Compare two channel entries.
The channel name and type fields are compared between two channel entries. The name field is given greater significance than the type field. The result is true if this entry name is less i.e. (name<ent.name || (name==ent.name && type<ent.type)).
| ent | Channel entry to be compared with this. |
| bool sends::chan_entry::operator== | ( | const chan_entry & | ent | ) | const [inline] |
| bool sends::chan_entry::operator!= | ( | const chan_entry & | ent | ) | const [inline] |
| double sends::chan_entry::rate | ( | void | ) | const [inline] |
Sample rate.
Return the channel sample rate.
1.5.5