![]() |
VRS
A file format for sensor data.
|
VRS stream identifier class. More...
#include <StreamId.h>
Public Member Functions | |
StreamId (const StreamId &rhs)=default | |
StreamId (RecordableTypeId typeId, uint16_t instanceId) | |
RecordableTypeId | getTypeId () const |
uint16_t | getInstanceId () const |
StreamId & | operator= (const StreamId &rhs)=default |
StreamId & | operator= (StreamId &&rhs)=default |
bool | operator== (const StreamId &rhs) const |
bool | operator!= (const StreamId &rhs) const |
bool | operator< (const StreamId &rhs) const |
Compare operator, so that we can use StreamId in containers, with a guarantied behavior. | |
bool | isValid () const |
string | getTypeName () const |
string | getName () const |
string | getFullName () const |
string | getNumericName () const |
Static Public Member Functions | |
static StreamId | fromNumericName (const string &numericName) |
static StreamId | fromNumericNamePlus (const string &numericName) |
static bool | isKnownTypeId (RecordableTypeId typeId) |
static StreamId | lowest () |
StreamId value guaranteed to be smaller than any valid StreamId object. | |
VRS stream identifier class.
Identifier for a stream of records, containing a RecordableTypeId and an instance id, so that multiple streams of the same kind can be recorded side-by-side in a VRS file unambiguously.
Note that instance ids are not meant to be controlled, set, or defined by the recording code.
During recording, VRS generates a unique instance id when a recordable is created, to ensure that each recordable has a unique stream id in the whole system. In particular, by design, if you stop recording, destroy the recordables and create new ones, the instance ids generated will keep increasing. Therefore, when discovering the streams in a VRS file, specific instance ids can't be used to recognize different instances of particular RecordableTypeId. Instead, use recordable tags or flavors. The APIs RecordFileReader::getStreamForTag() and RecordFileReader::getStreamForFlavor() can then quickly determine the StreamId for each of the streams in the file.
|
static |
Convert from a stream ID numeric string representation
numericName | a stream ID name in numeric representation, e.g., "1100-1" |
|
static |
Convert from a stream ID numeric string representation with a '+' sign between numbers Useful to parse relative stream IDs, which need a file for complete resolution.
numericName | a stream ID name in numeric representation, e.g., "1100+1" |
string vrs::StreamId::getFullName | ( | ) | const |
Get a complete name for the device, combining the numeric name and recordable type name.
|
inline |
Get the instance id.
string vrs::StreamId::getName | ( | ) | const |
Get a readable name for the device, combining the recordable type name and the instance id.
string vrs::StreamId::getNumericName | ( | ) | const |
Get a name combining the recordable type and the instance id, as numbers.
|
inline |
Get the recordable type id.
|
inline |
Get the name of the type of device.
|
static |
A recording might be using a type id not known by the current version of the code. This should not be problem, but in some situation, in particular display purposes in particular, it can be useful to be able to tell.
|
inline |
Test if the instance represents device. Useful when an API returns a StreamId, and needs to tell that no device was found.