ARC SDK
Public Member Functions
Arc::Period Class Reference

A Period represents a length of time. More...

#include <arc/DateTime.h>

Public Member Functions

 Period ()
 Default constructor. The period is set to 0 length. More...
 
 Period (time_t)
 Constructor that takes a time_t variable and stores it. More...
 
 Period (time_t seconds, uint32_t nanoseconds)
 Constructor that takes seconds and nanoseconds and stores them. More...
 
 Period (const std::string &, PeriodBase base=PeriodSeconds)
 Constructor that tries to convert a string. More...
 
Periodoperator= (time_t)
 Assignment operator from a time_t. More...
 
Periodoperator= (const Period &)
 Assignment operator from a Period. More...
 
void SetPeriod (time_t sec)
 Sets the period in seconds. More...
 
void SetPeriod (time_t sec, uint32_t nanosec)
 Sets the period in seconds and nanoseconds. More...
 
time_t GetPeriod () const
 Gets the period in seconds. More...
 
uint32_t GetPeriodNanoseconds () const
 Gets the number of nanoseconds after the last whole second. More...
 
const sigc::slot< const char * > * istr () const
 For use with IString. More...
 
 operator std::string () const
 Returns a string representation of the period. More...
 
bool operator< (const Period &) const
 Comparing two Period objects. More...
 
bool operator> (const Period &) const
 Comparing two Period objects. More...
 
bool operator<= (const Period &) const
 Comparing two Period objects. More...
 
bool operator>= (const Period &) const
 Comparing two Period objects. More...
 
bool operator== (const Period &) const
 Comparing two Period objects. More...
 
bool operator!= (const Period &) const
 Comparing two Period objects. More...
 
Periodoperator+= (const Period &)
 

Detailed Description

A Period represents a length of time.

Period represents a length of time (eg 2 mins and 30.1 seconds), whereas Time represents a moment of time (eg midnight on 1st Jan 2000).

See also
Time

Constructor & Destructor Documentation

◆ Period() [1/4]

Arc::Period::Period ( )

Default constructor. The period is set to 0 length.

◆ Period() [2/4]

Arc::Period::Period ( time_t  )

Constructor that takes a time_t variable and stores it.

◆ Period() [3/4]

Arc::Period::Period ( time_t  seconds,
uint32_t  nanoseconds 
)

Constructor that takes seconds and nanoseconds and stores them.

◆ Period() [4/4]

Arc::Period::Period ( const std::string &  ,
PeriodBase  base = PeriodSeconds 
)

Constructor that tries to convert a string.

Member Function Documentation

◆ GetPeriod()

time_t Arc::Period::GetPeriod ( ) const

Gets the period in seconds.

◆ GetPeriodNanoseconds()

uint32_t Arc::Period::GetPeriodNanoseconds ( ) const

Gets the number of nanoseconds after the last whole second.

◆ istr()

const sigc::slot<const char*>* Arc::Period::istr ( ) const

For use with IString.

◆ operator std::string()

Arc::Period::operator std::string ( ) const

Returns a string representation of the period.

◆ operator!=()

bool Arc::Period::operator!= ( const Period ) const

Comparing two Period objects.

◆ operator<()

bool Arc::Period::operator< ( const Period ) const

Comparing two Period objects.

◆ operator<=()

bool Arc::Period::operator<= ( const Period ) const

Comparing two Period objects.

◆ operator=() [1/2]

Period& Arc::Period::operator= ( time_t  )

Assignment operator from a time_t.

Python interface deviation
Method is unavailable in Python interface

◆ operator=() [2/2]

Period& Arc::Period::operator= ( const Period )

Assignment operator from a Period.

Python interface deviation
Method is unavailable in Python interface

◆ operator==()

bool Arc::Period::operator== ( const Period ) const

Comparing two Period objects.

◆ operator>()

bool Arc::Period::operator> ( const Period ) const

Comparing two Period objects.

◆ operator>=()

bool Arc::Period::operator>= ( const Period ) const

Comparing two Period objects.

◆ SetPeriod() [1/2]

void Arc::Period::SetPeriod ( time_t  sec)

Sets the period in seconds.

◆ SetPeriod() [2/2]

void Arc::Period::SetPeriod ( time_t  sec,
uint32_t  nanosec 
)

Sets the period in seconds and nanoseconds.


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