rtmlib
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
Event< T > Class Template Reference

#include <event.h>

Public Types

typedef T data_t
 

Public Member Functions

 Event ()
 
 Event (const T &data, const timespan &time)
 
const T & getData () const
 
const timespan & getTime () const
 
void set (T &, timespan &)
 
void setTime (timespan &)
 
void setData (T &)
 
void debug () const
 
Event< T > & operator= (const Event< T > *event)
 
bool operator< (const Event &event) const
 
bool operator<= (const Event &event) const
 
bool operator> (const Event &event) const
 
bool operator>= (const Event &event) const
 
bool operator== (const Event &event) const
 
bool operator!= (const Event &event) const
 
bool operator< (const timespan &time) const
 
bool operator<= (const timespan &time) const
 
bool operator> (const timespan &time) const
 
bool operator>= (const timespan &time) const
 
bool operator== (const timespan &time) const
 
bool operator!= (const timespan &time) const
 

Private Attributes

data
 
timespan time
 

Friends

template<typename D >
bool operator< (const timespan &time, const Event< D > &event)
 
template<typename D >
bool operator<= (const timespan &time, const Event< D > &event)
 
template<typename D >
bool operator> (const timespan &time, const Event< D > &event)
 
template<typename D >
bool operator>= (const timespan &time, const Event< D > &event)
 
template<typename D >
bool operator== (const timespan &time, const Event< D > &event)
 
template<typename D >
bool operator!= (const timespan &time, const Event< D > &event)
 

Detailed Description

template<typename T>
class Event< T >

Event data container that keeps a timestamp of the event.

Timestamps are parameterized.

Author
André Pedro
Date

Member Typedef Documentation

◆ data_t

template<typename T>
typedef T Event< T >::data_t

Constructor & Destructor Documentation

◆ Event() [1/2]

template<typename T >
Event< T >::Event ( )

Instantiates a new event.

Instantiates a new event, nothing is zeroed out.

◆ Event() [2/2]

template<typename T >
Event< T >::Event ( const T &  data,
const timespan &  time 
)

Instantiates a new event with data and time parameters.

Both data and time are instantiated using copy constructors.

Parameters
dataa constant reference to the data being copied.
timeconstant reference to the time being copied.

Member Function Documentation

◆ debug()

template<typename T >
void Event< T >::debug ( ) const

Debug function

◆ getData()

template<typename T >
const T & Event< T >::getData ( ) const

Gets the event current data.

Returns
a reference to this events Data.

◆ getTime()

template<typename T >
const timespan & Event< T >::getTime ( ) const

Gets the event creation time.

Returns
the event current time.

◆ operator!=() [1/2]

template<typename T >
bool Event< T >::operator!= ( const Event< T > &  event) const

Checks if this event is != than Event event.

Parameters
eventAnother event.
Returns
whether this event is != than Event event.

◆ operator!=() [2/2]

template<typename T >
bool Event< T >::operator!= ( const timespan &  time) const

Checks if this event is != than timespec time.

Parameters
timea timespec as defined by time.h
Returns
whether this event is != than timespec time.

◆ operator<() [1/2]

template<typename T >
bool Event< T >::operator< ( const Event< T > &  event) const

Checks if this event is < than Event event.

Parameters
eventAnother event.
Returns
whether this event is < than Event event.

◆ operator<() [2/2]

template<typename T >
bool Event< T >::operator< ( const timespan &  time) const

Checks if this event is < than timespec time.

Parameters
timea timespec as defined by time.h
Returns
whether this event is < than timespec time.

◆ operator<=() [1/2]

template<typename T >
bool Event< T >::operator<= ( const Event< T > &  event) const

Checks if this event is <= than Event event.

Parameters
eventAnother event.
Returns
whether this event is <= than Event event.

◆ operator<=() [2/2]

template<typename T >
bool Event< T >::operator<= ( const timespan &  time) const

Checks if this event is <= than timespec time.

Parameters
timea timespec as defined by time.h
Returns
whether this event is <= than timespec time.

◆ operator=()

template<typename T >
Event< T > & Event< T >::operator= ( const Event< T > *  event)

Copies the Events data pointed by event to this object.

Parameters
eventThe volatile data to copy to this object.

◆ operator==() [1/2]

template<typename T >
bool Event< T >::operator== ( const Event< T > &  event) const

Checks if this event is == to Event event.

Parameters
eventAnother event.
Returns
whether this event is == to Event event.

◆ operator==() [2/2]

template<typename T >
bool Event< T >::operator== ( const timespan &  time) const

Checks if this event is == to timespec time.

Parameters
timea timespec as defined by time.h
Returns
whether this event is == to timespec time.

◆ operator>() [1/2]

template<typename T >
bool Event< T >::operator> ( const Event< T > &  event) const

Checks if this event is > than Event event.

Parameters
eventAnother event.
Returns
whether this event is > than Event event.

◆ operator>() [2/2]

template<typename T >
bool Event< T >::operator> ( const timespan &  time) const

Checks if this event is > than timespec time.

Parameters
timea timespec as defined by time.h
Returns
whether this event is > than timespec time.

◆ operator>=() [1/2]

template<typename T >
bool Event< T >::operator>= ( const Event< T > &  event) const

Checks if this event is >= than Event event.

Parameters
eventAnother event.
Returns
whether this event is >= than Event event.

◆ operator>=() [2/2]

template<typename T >
bool Event< T >::operator>= ( const timespan &  time) const

Checks if this event is >= than timespec time.

Parameters
timea timespec as defined by time.h
Returns
whether this event is >= than timespec time.

◆ set()

template<typename T >
void Event< T >::set ( T &  d,
timespan &  t 
)

Set event

◆ setData()

template<typename T >
void Event< T >::setData ( T &  d)

Set data of the event

◆ setTime()

template<typename T >
void Event< T >::setTime ( timespan &  t)

Set time of the event

Friends And Related Function Documentation

◆ operator!=

template<typename T>
template<typename D >
bool operator!= ( const timespan &  time,
const Event< D > &  event 
)
friend

Checks if timespec time is != than Event event.

Parameters
timea timespec as defined by time.h
eventan event
Returns
whether timespec time is != than Event event.

◆ operator<

template<typename T>
template<typename D >
bool operator< ( const timespan &  time,
const Event< D > &  event 
)
friend

Checks if timespec time is < than Event event.

Parameters
timea timespec as defined by time.h
eventan event
Returns
whether timespec time is < than Event event.

◆ operator<=

template<typename T>
template<typename D >
bool operator<= ( const timespan &  time,
const Event< D > &  event 
)
friend

Checks if timespec time is < than Event event.

Parameters
timea timespec as defined by time.h
eventan event
Returns
whether timespec time is < than Event event.

◆ operator==

template<typename T>
template<typename D >
bool operator== ( const timespan &  time,
const Event< D > &  event 
)
friend

Checks if timespec time is == than Event event.

Parameters
timea timespec as defined by time.h
eventan event
Returns
whether timespec time is == than Event event.

◆ operator>

template<typename T>
template<typename D >
bool operator> ( const timespan &  time,
const Event< D > &  event 
)
friend

Checks if timespec time is <= than Event event.

Parameters
timea timespec as defined by time.h
eventan event
Returns
whether timespec time is <= than Event event.

◆ operator>=

template<typename T>
template<typename D >
bool operator>= ( const timespan &  time,
const Event< D > &  event 
)
friend

Checks if timespec time is > than Event event.

Parameters
timea timespec as defined by time.h
eventan event
Returns
whether timespec time is > than Event event.

Member Data Documentation

◆ data

template<typename T>
T Event< T >::data
private

Data container for this Event.

◆ time

template<typename T>
timespan Event< T >::time
private

Creation time for this Event


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