Data
segment descriptor.
More...
#include <segment.hh>
List of all members.
Detailed Description
Data
segment descriptor.
The segments class contains all the information about an existing (or soon to exist) segment of channel data.
- Author:
- J.Zweizig
- Version:
- 1.0; Last modified December 31, 2007
Member Typedef Documentation
Data type used for start and stop times.
Data type used for use count.
Copy channel index from the chan_list class. The channel index is used as a to indicate whic channel the segment data are from.
Constructor & Destructor Documentation
| sends::segment::segment |
( |
void |
|
) |
|
Constructor.
Construct a segment descriptor.
| sends::segment::~segment |
( |
void |
|
) |
|
Segment destructor.
Destroy a segment descriptor.
Member Function Documentation
| bool sends::segment::canUse |
( |
int |
bufclass |
) |
const [inline] |
Test usable.
Test whether the segment can be taken for a buffer class specified. The sement must be unused (mUseCount == 0) and have the sppropriate buffer class. A search buffer class of -1 selects a segment with no allocated buffer.
- Parameters:
-
| bufclass | Class of buffer being searched for. |
- Returns:
- True if segment can be used.
Get channel index.
Get the channel index for the channel being stored by this segment descriptor.
- Returns:
- Index of channel whose data are contained in segment.
| unsigned long sends::segment::dataIndex |
( |
gps_type |
gps |
) |
const |
Calculate data position.
Get the index of the specified time in the data buffer.
- Parameters:
-
| gps | Time to be calculated. |
- Returns:
- Index to specified data.
| std::ostream& sends::segment::dump |
( |
std::ostream & |
out |
) |
const |
Dump segment status.
Dump the status of the segment.
- Parameters:
-
| out | Output stream reference. |
- Returns:
- Output stream reference.
| static std::ostream& sends::segment::dump_header |
( |
std::ostream & |
out |
) |
[static] |
Dump status header.
Dump the segment status header.
- Parameters:
-
| out | Output stream reference. |
- Returns:
- Output stream reference.
| bool sends::segment::empty |
( |
void |
|
) |
const [inline] |
Extend data.
The specified data are appended to thos already in the data buffer.
- Parameters:
-
| data | Data to be appended to the segment. |
| inx | Index of data to be added to the segment. |
| length | Length of data words to be added to the segment. |
| void sends::segment::fill_lock |
( |
void |
|
) |
|
Lock the segment for filling.
Lock the segment to add data. The data position and currently existing data (as defined by the start and stop times) remain available for read access. No manipulation of the stop time, or the reserved data time should occurr without fist issuing a fill_lock request.
| void sends::segment::fill_unlock |
( |
void |
|
) |
|
Unlock the fill mutex.
Unlock the segment for filling.
| bool sends::segment::full |
( |
void |
|
) |
const [inline] |
Test full.
Test whether the segment buffer is full.
- Returns:
- True if full.
| int sends::segment::getBufClass |
( |
void |
|
) |
const [inline] |
Get buffer class.
Return the buffer class code of the buffer allocated for this segment. If no buffer is allocated, the class code is set to -1.
- Returns:
- Buffer class code.
Get end time.
Get data end time.
- Returns:
- Data end time.
Get max time.
Get buffer full time.
- Returns:
- Buffer max time.
Get sreserve time.
Get data reserve time.
- Returns:
- Data reserve time.
Get start time.
Get data Start time.
- Returns:
- Data start time.
Get use count.
Get the current use count. The getUseCount method is not implicitly sychronized using a mutex so unless the caller issues a read-lock the count may be modified at any time after it is used.
- Returns:
- Use count.
| bool sends::segment::in_segment |
( |
gps_type |
gps |
) |
const [inline] |
Test if time is in this segment.
Test whether the specified time is within the range covered by this segment.
- Parameters:
-
- Returns:
- True if specified time is in the segment time range.
| bool sends::segment::inUse |
( |
void |
|
) |
const [inline] |
Test if the segment is in use.
Test whether this segment is in use, i.e. if the use count is non-zero.
- Returns:
- True if the segment is in use.
| bool sends::segment::operator< |
( |
const segment & |
seg |
) |
const [inline] |
compare time order of two segments.
Compare the times of two segment objects. The l.h.s. segment is less if its stop time is before or equal to the start time of the r.h.s. segment.
- Parameters:
-
| seg | Segment to be compared to this. |
- Returns:
- True if this segment is before the argument segment.
References mStart.
| double sends::segment::rate |
( |
void |
|
) |
const [inline] |
Sample rate.
Return the sample rate in Hz.
- Returns:
- Sample rate in Hz.
| const char* sends::segment::refData |
( |
gps_type |
gps |
) |
const |
Return pointer to specified data.
Return a constant pointer to the data item at the specified GPS time.
- Parameters:
-
| gps | Gps time of requested data. |
- Returns:
- Consant pointer to data sample at specified time.
| char* sends::segment::refData |
( |
gps_type |
gps |
) |
|
Return pointer to specified data.
Return a pointer to the data item at the specified GPS time.
- Parameters:
-
| gps | Gps time of requested data. |
- Returns:
- Pointer to data sample at specified time.
| void sends::segment::release |
( |
void |
|
) |
|
Extend reserved buffer space.
Extend buffer space to the specified time by incrementing the reserved pointer.
- Parameters:
-
| start | start of reserved interval. |
| stop | Time at end of buffer space. |
| void sends::segment::set_buffer |
( |
buffer * |
bufpt, |
|
|
int |
btype | |
|
) |
| | |
Set the buffer.
Set the buffer to one of the specified type from the pool manager provided.
- Parameters:
-
| bufpt | Buffer address. |
| btype | Buffer type code. |
- Returns:
- Writeable reference to the specified segment.
| void sends::segment::set_segment |
( |
chan_index |
chan, |
|
|
double |
rate, |
|
|
int |
len, |
|
|
gps_type |
start | |
|
) |
| | |
Set up a buffer.
Set the buffer content information to as appropriate for the specified channel and start-time.
- Parameters:
-
| chan | Index of channel to be assigned to the segment. |
| rate | Channel sample rate |
| len | Channel data word length |
| start | Start time of segment |
| void sends::segment::use |
( |
void |
|
) |
|
| void sends::segment::unuse |
( |
void |
|
) |
|
The documentation for this class was generated from the following file: