DUECA/DUSIME
|
Data selector class. More...
#include <DataReader.hxx>
Public Member Functions | |
VirtualJoin (DataReaderBase &r) | |
Constructor. | |
const T & | access (DataReaderBase &r) |
access the data object. | |
const void | release (ChannelReadToken &token) |
Release a previous access. | |
Public Attributes | |
const T * | data_ptr |
Pointer to a data copy. | |
Additional Inherited Members | |
Protected Member Functions inherited from dueca::DataReaderBaseAccess | |
const void * | getAccess (DataReaderBase &b, TimeTickType t, DataTimeSpec &ts_data, unsigned int magic) |
Get access to the data valid at a specific time. | |
const DataTimeSpec & | t_request (DataReaderBase &b) |
Access the DataReaderBase request time. | |
DataTimeSpec & | ts_data (DataReaderBase &b) |
Access the DataReaderBase data time. | |
bool & | firstaccess (DataReaderBase &b) |
Access the DataReaderBase access boolean. | |
void | releaseAccess (ChannelReadToken &token, const void *data_ptr) |
Release the read access again. | |
void | releaseAccess (DataReaderBase &b, const void *data_ptr) |
Release the read access again, from a base. | |
void | releaseAccessKeepData (ChannelReadToken &token, const void *data_ptr) |
Release the read access, but keep the current data. | |
void | selectFirstEntry (DataReaderBase &b) |
Select the first entry in a multi-entry read. | |
bool | haveEntry (DataReaderBase &b) |
Is there an entry currently. | |
void | selectNextEntry (DataReaderBase &b) |
Pass to the next entry. | |
const GlobalId & | getChannelId (DataReaderBase &b) |
Get the id of the channel. | |
const GlobalId & | getClientId (DataReaderBase &b) |
Get the id of the accessing client. | |
bool | isSequential (DataReaderBase &b) |
Is reading sequential, or indexed-access. | |
Data selector class.
The DataReader objects access data in a channel using ChannelReadToken objects. A DataReader is supplied with a time specification for the requested data interval at its construction. The data selector class template parameter defines how that interval is interpreted in accessing the data.
Behaviour of this VirtualJoin class, explained for four cases:
Time access reading specified for the token (Channel::JumpToMatchTime):
This mode is deemed irrelevant for this case. If used anyhow, it will normally access the first entry that is available, given that that entry has data for the specified time. If there is no data for that time, the next entry (in the order in which the entries happen to be arranged in the channel) is selected, and so on. Reading fails when none of the entries have data for the requested time.
The accessed channel entry contains stream data:
Probably not that relevant. All available data stretches from the first entry will be read, then from the second, etc. If in the meantime new available data arrives on the first, the reading will jump back.
The accessed channel entry contains event data:
All available events will be read, preference is given to the first entries, as in the above case. If none of the entries have new (unread) data available for the current time (i.e. no data at all or only data written later than the start of the specified span) the access returns a NoDataAvailable exception.
|
inline |
Constructor.
Essential to initialize data pointer. Also does the access.
|
inline |
access the data object.
Cycles through all entries until a valid data point is found