Timestamp Struct Reference

Structure representing timestamps with utilities. More...

Functions

 Timestamp ()
 Default constructor. More...
 
 Timestamp (uint64_t _data_ns)
 Initialized the sl::Timestamp instance to a number in nanoseconds. More...
 
uint64_t getNanoseconds ()
 Returns the timestamp in nanoseconds. More...
 
uint64_t getMicroseconds ()
 Returns the timestamp in microseconds. More...
 
uint64_t getMilliseconds ()
 Returns the timestamp in milliseconds. More...
 
uint64_t getSeconds ()
 Returns the timestamp in seconds. More...
 
void setNanoseconds (uint64_t t_ns)
 Sets the timestamp to a value in nanoseconds. More...
 
void setMicroseconds (uint64_t t_us)
 Sets the timestamp to a value in microseconds. More...
 
void setMilliseconds (uint64_t t_ms)
 Sets the timestamp to a value in milliseconds. More...
 
void setSeconds (uint64_t t_s)
 Sets the timestamp to a value in seconds. More...
 
Timestampoperator= (Timestamp other)
 Copy the value of another sl::Timestamp. More...
 
Timestampoperator= (uint64_t other_data_ns)
 Sets the value of the sl::Timestamp to other_data_ns. More...
 
Timestampoperator+= (const Timestamp &rhs)
 Adds the value of another sl::Timestamp to the current one. More...
 
Timestampoperator-= (const Timestamp &rhs)
 Subtracts the value of another sl::Timestamp to the current one. More...
 
Timestampoperator*= (const Timestamp &rhs)
 Multiplies the value of another sl::Timestamp to the current one. More...
 
Timestampoperator/= (const Timestamp &rhs)
 Divides the value of the current sl::Timestamp by another one. More...
 
 operator unsigned long long int () const
 Convert the sl::Timestamp into a unsigned long long int. More...
 

Attributes

uint64_t data_ns = 0
 Timestamp in nanoseconds. More...
 

Detailed Description

Structure representing timestamps with utilities.

Constructor and Destructor

◆ Timestamp() [1/2]

Timestamp ( )
inline

Default constructor.

Initialized the sl::Timestamp instance to 0.

◆ Timestamp() [2/2]

Timestamp ( uint64_t  _data_ns)
inline

Initialized the sl::Timestamp instance to a number in nanoseconds.

Functions

◆ getNanoseconds()

uint64_t getNanoseconds ( )
inline

Returns the timestamp in nanoseconds.

◆ getMicroseconds()

uint64_t getMicroseconds ( )
inline

Returns the timestamp in microseconds.

◆ getMilliseconds()

uint64_t getMilliseconds ( )
inline

Returns the timestamp in milliseconds.

◆ getSeconds()

uint64_t getSeconds ( )
inline

Returns the timestamp in seconds.

◆ setNanoseconds()

void setNanoseconds ( uint64_t  t_ns)
inline

Sets the timestamp to a value in nanoseconds.

◆ setMicroseconds()

void setMicroseconds ( uint64_t  t_us)
inline

Sets the timestamp to a value in microseconds.

◆ setMilliseconds()

void setMilliseconds ( uint64_t  t_ms)
inline

Sets the timestamp to a value in milliseconds.

◆ setSeconds()

void setSeconds ( uint64_t  t_s)
inline

Sets the timestamp to a value in seconds.

◆ operator=() [1/2]

Timestamp& operator= ( Timestamp  other)
inline

Copy the value of another sl::Timestamp.

◆ operator=() [2/2]

Timestamp& operator= ( uint64_t  other_data_ns)
inline

Sets the value of the sl::Timestamp to other_data_ns.

◆ operator+=()

Timestamp& operator+= ( const Timestamp rhs)
inline

Adds the value of another sl::Timestamp to the current one.

◆ operator-=()

Timestamp& operator-= ( const Timestamp rhs)
inline

Subtracts the value of another sl::Timestamp to the current one.

◆ operator*=()

Timestamp& operator*= ( const Timestamp rhs)
inline

Multiplies the value of another sl::Timestamp to the current one.

◆ operator/=()

Timestamp& operator/= ( const Timestamp rhs)
inline

Divides the value of the current sl::Timestamp by another one.

◆ operator unsigned long long int()

operator unsigned long long int ( ) const
inline

Convert the sl::Timestamp into a unsigned long long int.

Variables

◆ data_ns