sends::chan_list Class Reference

Channel list. More...

#include <chan_list.hh>

List of all members.

Public Types

typedef unsigned long chan_index
 Channel index.

Public Member Functions

 chan_list (unsigned long ndef=100000)
 Construct empty channel list.
chan_index add_channel (const chan_entry &ce)
 Add a channel to the channel list.
void clear (void)
std::ostream & dump (std::ostream &out) const
 Dump the channel list contents.
void enable (void)
chan_index find (const std::string &name, chan_entry::chan_type t) const
 Find channel entry
Exceptions:
runtime_error if not found.

chan_index find (const chan_entry &ent) const
chan_index find_best (const std::string &name, chan_entry::chan_type t, double rate, chan_entry::gps_type gps) const
chan_index lower_bound (const chan_entry &ent) const
void read (const std::string &file)
 Read channel file.
void reserve (chan_index nMax)
 reserve the specified number of entries
chan_index size (void) const
const chan_entryoperator[] (chan_index inx) const
 Reference the specified entry.


Detailed Description

Channel list.

Master channel list.

Author:
John Zweizig
Version:
1.0; Last modified: January 23, 2008

Member Typedef Documentation

typedef unsigned long sends::chan_list::chan_index

Channel index.

Data type used to represent an index into the channel list.


Constructor & Destructor Documentation

sends::chan_list::chan_list ( unsigned long  ndef = 100000  ) 

Construct empty channel list.

Construct an empty channel list. The list_available flag is cleared to prevent clients from using the channel list information.

Parameters:
ndef Number of entries to preallocate.


Member Function Documentation

chan_index sends::chan_list::add_channel ( const chan_entry ce  ) 

Add a channel to the channel list.

Add the specified channel to the channel list. If the list is available for read access, an exception is thrown.

Parameters:
ce Channel entry

void sends::chan_list::clear ( void   ) 

Clear the list and reset the available flag.

std::ostream& sends::chan_list::dump ( std::ostream &  out  )  const

Dump the channel list contents.

Dump the contents of the channel list to the specified output stream.

Parameters:
out Output stream.
Returns:
Reference to the argument output stream.

void sends::chan_list::enable ( void   ) 

Enable the list for read access.

chan_index sends::chan_list::find ( const std::string &  name,
chan_entry::chan_type  t 
) const

Find channel entry

Exceptions:
runtime_error if not found.

Find the specified channel entry in the list. A runtime_error exception is thrown if the channel is not found.

Parameters:
name Name of channel to be found.
t Channel type.
Returns:
Index into the channel list.

chan_index sends::chan_list::find ( const chan_entry ent  )  const

Find the specified channel entry in the list. A runtime_error exception is thrown if the channel is not found.

Exceptions:
runtime_error if not found.
Parameters:
ent Channel entry (name, type) to be found.
Returns:
index into the channel list.

chan_index sends::chan_list::find_best ( const std::string &  name,
chan_entry::chan_type  t,
double  rate,
chan_entry::gps_type  gps 
) const

Find the channel with the nearest parameters.

Exceptions:
runtime_error if not found.
Parameters:
name Name of channel to be found.
t Channel type.
rate Sample rate
Returns:
index into the channel list.

chan_index sends::chan_list::lower_bound ( const chan_entry ent  )  const

Find the first entry in the list greater or equal to the specified entry;

Parameters:
ent Channel entry to be found.
Returns:
index into the channel list.

void sends::chan_list::read ( const std::string &  file  ) 

Read channel file.

Fill the channel list from a file of channel definitions. The file contains one channel definition per line. Comments may be included by following any definition text with a pound sign and the comment text. A channel definition may be continued on one or more additional lines by typing a backslash as the last character of the non-terminal line(s). definition fields are separated by white-space characters an contain the following
ColumnContents
1Channel name
2Channel type
3Minimum access level
4Data type
5Sample rate
6 - nSource frame(s)

Parameters:
file Path to a file of channel definitions.

void sends::chan_list::reserve ( chan_index  nMax  ) 

reserve the specified number of entries

Extent the channel list to contain at least the specified number of entries. No action is taken if the current capacity is at least the specified number of entries.

Parameters:
nMax new capacity

chan_list::chan_index sends::chan_list::size ( void   )  const [inline]

Return the number of active entries in the channel list.

Returns:
The number of entris in the channel list.

const chan_entry& sends::chan_list::operator[] ( chan_index  inx  )  const

Reference the specified entry.

Get a constant reference to the entry specified by the channel index.

Parameters:
inx Index to the desired channel entry.
Exceptions:
std::out_of_range is thrown if the index is invalid.
Returns:
constant reference to the channel entry.


The documentation for this class was generated from the following file:

Generated on Tue Jun 10 12:18:12 2008 for SENDS by  doxygen 1.5.5