|
DUECA/DUSIME
|
Lightweight class for accessing data in a channel. More...
#include <DataReader.hxx>


Public Member Functions | |
| DataReader (ChannelReadToken &token, const DataTimeSpec &ts) | |
| Constructor. More... | |
| DataReader (ChannelReadToken &token, const TimeSpec &ts) | |
| Constructor with TimeSpec. More... | |
| DataReader (ChannelReadToken &token, TimeTickType ts=MAX_TIMETICK) | |
| Constructor with time tick. More... | |
| const T & | data () |
| Access to the data. More... | |
| const DataTimeSpec & | timeSpec () |
| Return the time specification of the data. | |
| const GlobalId & | origin () |
| Return the origin. | |
| ~DataReader () | |
| Destructor. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from dueca::DataReaderBase | |
| DataReaderBase (ChannelReadToken &token, const DataTimeSpec &t_request) | |
| Constructor. | |
Protected Attributes inherited from dueca::DataReaderBase | |
| ChannelReadToken & | token |
| Reference to the channel access token. | |
| DataTimeSpec | t_request |
| Time span or point requested. | |
| DataTimeSpec | ts_data |
| Time specification as realised. | |
| GlobalId | data_origin |
| Data origin. | |
| bool | firstaccess |
| First access flag. | |
Lightweight class for accessing data in a channel.
The DataReader accesses the data in a channel. These objects should be created on the stack, and when they go out of scope, the access to the channel is released again.
Example:
Parameters:
| T | Class of the data to be read. |
| S | Data time selector. |
Typical data time selectors are:
MatchIntervalStart. Data is read that matches the start of the time specification interval. When reading all datapoints (with Channel::ReadAllData, Channel::ReadReservation, or Channel::AdaptEventStream in combination with Channel::Events), older data is also returned.
MatchIntervalStartOrEarlier. If data is not available for the requested time, but older data is available, then that older data is returned.
VirtualJoin. Produces a combined reading of all entries in a channel, typically only selected for event data. Note that it might be necessary for channels with many entries and a higher frequency of data writing, to repeatedly try reading to prevent data buildup in the channel.
|
inline |
Constructor.
Note that these objects are light-weight, and meant to be constructed (on the stack) and discarded.
| token | Read token |
| ts | Time specification. Exact interpretation depends on the S template parameter. |
|
inline |
Constructor with TimeSpec.
| token | Read token. |
| ts | Time specification. Accessed data point will not be newer than ts.getValidityStart() |
|
inline |
Constructor with time tick.
| token | Read token. |
| ts | Time tick. Accessed data point will not be newer than the tick. Note that the default (not specifying this parameter) simply gives you the latest data in the channel, if JumpToMatchTime is selected for the read token. |
|
inline |
Destructor.
Releases the access again with a token.
|
inline |
Access to the data.
Note that the constructors are lazy. The getAccess() call will perform the actual access.