8#ifndef META_OCEAN_IO_SERIALIZATION_DATA_TIMESTAMP_H
9#define META_OCEAN_IO_SERIALIZATION_DATA_TIMESTAMP_H
77 inline bool isInt()
const;
89 inline int64_t
asInt()
const;
191 value_.doubleValue_ = value;
215 return value_.doubleValue_;
238 return double(
asInt());
253 ocean_assert(
false &&
"Value types do not match");
274 ocean_assert(
false &&
"Value types do not match");
This class implements an output bitstream.
Definition Bitstream.h:215
int64_t asInt() const
Returns the int64 value of this timestamp.
Definition DataTimestamp.h:218
union Ocean::IO::Serialization::DataTimestamp::@351356232065332247155100032252002330343237212072 value_
The union holding the value.
double doubleValue_
The double value.
Definition DataTimestamp.h:179
double forceDouble() const
Returns the timestamp as a double value regardless of the actual value type.
Definition DataTimestamp.h:226
static bool write(OutputBitstream &outputBitstream, const DataTimestamp &dataTimestamp)
Writes a data timestamp to an output bitstream.
double asDouble() const
Returns the double value of this timestamp.
Definition DataTimestamp.h:210
ValueType valueType_
The value type.
Definition DataTimestamp.h:185
bool isDouble() const
Returns whether this timestamp holds a double value.
Definition DataTimestamp.h:200
bool isInt() const
Returns whether this timestamp holds an int64 value.
Definition DataTimestamp.h:205
bool isValid() const
Returns whether this timestamp is valid.
Definition DataTimestamp.h:242
bool operator==(const DataTimestamp &dataTimestamp) const
Returns whether two timestamps are equal.
DataTimestamp operator+(const DataTimestamp &dataTimestamp) const
Adds two timestamps and returns the result.
Definition DataTimestamp.h:247
bool operator>=(const DataTimestamp &dataTimestamp) const
Returns whether this timestamp is greater than or equal to another timestamp.
bool operator<=(const DataTimestamp &dataTimestamp) const
Returns whether this timestamp is less than or equal to another timestamp.
bool operator>(const DataTimestamp &dataTimestamp) const
Returns whether this timestamp is greater than another timestamp.
DataTimestamp()=default
Creates a new invalid data timestamp.
DataTimestamp & operator+=(const DataTimestamp &dataTimestamp)
Adds another timestamp to this timestamp.
Definition DataTimestamp.h:268
bool operator<(const DataTimestamp &dataTimestamp) const
Returns whether this timestamp is less than another timestamp.
int64_t intValue_
The int64 value.
Definition DataTimestamp.h:181
ValueType
Definition of the value types.
Definition DataTimestamp.h:39
@ VT_DOUBLE
Double value type.
Definition DataTimestamp.h:43
@ VT_INT64
Int64 value type.
Definition DataTimestamp.h:45
@ VT_INVALID
Invalid value type.
Definition DataTimestamp.h:41
static bool read(InputBitstream &inputBitstream, DataTimestamp &dataTimestamp)
Reads a data timestamp from an input bitstream.
Namespace of the Ocean IO Serialization library.
Definition DataSample.h:29
Namespace of the Ocean IO library.
Definition Base64.h:17
The namespace covering the entire Ocean framework.
Definition Accessor.h:15