NAP
Public Member Functions | Public Attributes | List of all members
TimeStamp Class Referencefinal

#include <nap/datetime.h>

Public Member Functions

 TimeStamp ()=default
 
 TimeStamp (int64_t timeStamp)
 
 TimeStamp (const SystemTimeStamp &systemTime)
 
void fromSystemTime (const SystemTimeStamp &systemTime)
 
SystemTimeStamp toSystemTime () const
 
bool isValid () const
 

Public Attributes

int64_t mTimeStamp = -1
 Property: 'Time' time since epoch stored as long. More...
 

Description

A serializable time stamp, represented as a 64 bit long value. Use this object when serialization / de-serialization of a point in time is necessary. When dealing with time at run-time use the default nap::DateTime object. This is a relatively light weight object that can be both copy and move constructed or assigned.

Constructor & Destructor Documentation

◆ TimeStamp() [1/3]

TimeStamp ( )
default

Default Constructor

◆ TimeStamp() [2/3]

TimeStamp ( int64_t  timeStamp)

Default Constructor

Parameters
timeStamptime since epoch as long

◆ TimeStamp() [3/3]

TimeStamp ( const SystemTimeStamp systemTime)

Constructor based on given system time. Converts system time to a long that can be serialized.

Parameters
systemTimesystem time stamp to convert to serializable time stamp.

Member Function Documentation

◆ fromSystemTime()

void fromSystemTime ( const SystemTimeStamp systemTime)

Converts a system time stamp into a long that can be serialized

Parameters
systemTimetime stamp to convert

◆ isValid()

bool isValid ( ) const
Returns
if the timestamp managed by this object is valid, ie: has been set

◆ toSystemTime()

SystemTimeStamp toSystemTime ( ) const
Returns
the system time stamp based on stored internal time

Member Data Documentation

◆ mTimeStamp

int64_t mTimeStamp = -1

Property: 'Time' time since epoch stored as long.