Class that represents a timestamp type. More...

#include <SPL/Runtime/Type/Timestamp.h>

Detailed Description

Class that represents a timestamp type.

Common usage is to store the seconds and nanoseconds since the Unix Epoch (Jan 1, 1970), but this is not enforced by the timestamp class. machineId may be used to detect if two timestamps were created on the same machine, as there may be variations in the clocks on different machines. machineId's are ignored for comparisons and arithmetic operations on timestamps.

Constructor & Destructor Documentation

◆ timestamp() [1/4]

Empty constructor

◆ timestamp() [2/4]

Constructor

Parameters

◆ timestamp() [3/4]

Constructor

Parameters

◆ timestamp() [4/4]

Copy contructor

Parameters

Member Function Documentation

◆ set()

Set seconds since epoch and nanoseconds

Parameters

◆ setSeconds()

Set seconds since epoch

Parameters

◆ setNanoSeconds()

Set nanoseconds

Parameters

◆ setMachineId()

Set machine id

Parameters

◆ getSeconds()

Get seconds since epoch

Returns
the seconds since epoch component

◆ getNanoseconds()

Get nanoseconds

Returns
the nanosecond component

◆ getMachineId()

Get machine id

Returns
the machine id

◆ operator-()

Difference. The machine id from the left-hand-size operand is used in result.

Parameters
Returns
difference between the timestamps

◆ operator-=()

Difference (assignment)

Parameters
Returns
*this

◆ operator+()

Sum. The machine id from the left-hand-size operand is used in result.

Parameters
Returns
sum of the timestamps

◆ operator+=()

Sum (assignment)

Parameters
Returns
*this

◆ operator==()

Equality comparison

Parameters
Returns
true if the timestamps are the same, false otherwise

◆ operator!=()

Non-equality comparison

Parameters
Returns
true if the timestamps are not the same, false otherwise

◆ operator<()

Less than comparison

Parameters
Returns
true if timestamp < rhs, false otherwise

◆ operator>=()

Greater than or equal comparison

Parameters
Returns
true if timestamp >= rhs, false otherwise

◆ operator>()

Greater than comparison

Parameters
Returns
true if timestamp > rhs, false otherwise

◆ operator<=()

Less than or equal comparison

Parameters
Returns
true if timestamp <= rhs, false otherwise

◆ swap()

Swap

Parameters

◆ serialize() [1/2]

template<class BufferType >

Serialize (binary)

Parameters

◆ deserialize() [1/2]

template<class BufferType >

Deserialize (binary)

Parameters

◆ serialize() [2/2]

Serialize (character)

Parameters

◆ deserialize() [2/2]

Deserialize (character)

Parameters

◆ hashCode()

Get hash code

Returns
hash code

◆ getSerializedSize()

Get the size in bytes when serialized

Returns
size in bytes when serialized

◆ min()

The minimum timestamp value.

◆ max()

The maximum timestamp value.


The documentation for this class was generated from the following file: