Public Member Functions | Public Attributes | Friends | List of all members
sdf::v11::Time Class Reference

A Time class, can be used to hold wall- or sim-time. More...

#include <Types.hh>

Public Member Functions

 Time ()
 Constructor. More...
 
 Time (int32_t _sec, int32_t _nsec)
 Constructor. More...
 
bool operator== (const Time &_time) const
 Equal to operator. More...
 

Public Attributes

int32_t nsec
 Nanoseconds. More...
 
int32_t sec
 Seconds. More...
 

Friends

std::ostream & operator<< (std::ostream &_out, const Time &_time)
 Stream insertion operator. More...
 
std::istream & operator>> (std::istream &_in, Time &_time)
 Stream extraction operator. More...
 

Detailed Description

A Time class, can be used to hold wall- or sim-time.

stored as sec and nano-sec.

Constructor & Destructor Documentation

◆ Time() [1/2]

sdf::v11::Time::Time ( )
inline

Constructor.

◆ Time() [2/2]

sdf::v11::Time::Time ( int32_t  _sec,
int32_t  _nsec 
)
inline

Constructor.

Parameters
[in]_secSeconds
[in]_nsecNanoseconds

Member Function Documentation

◆ operator==()

bool sdf::v11::Time::operator== ( const Time _time) const
inline

Equal to operator.

Parameters
[in]_timethe time to compare to.
Returns
true if values are the same, false otherwise.

References nsec, and sec.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  _out,
const Time _time 
)
friend

Stream insertion operator.

Parameters
[in]_outthe output stream
[in]_timetime to write to the stream
Returns
the output stream

◆ operator>>

std::istream& operator>> ( std::istream &  _in,
Time _time 
)
friend

Stream extraction operator.

Parameters
[in]_inthe input stream
[in]_timetime to read from to the stream
Returns
the input stream

Member Data Documentation

◆ nsec

int32_t sdf::v11::Time::nsec

Nanoseconds.

Referenced by operator==().

◆ sec

int32_t sdf::v11::Time::sec

Seconds.

Referenced by operator==().


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