Fawkes API  Fawkes Development Version
fawkes::TimeSourceAspect Class Reference

Thread aspect that allows to provide a time source to the Fawkes clock. More...

#include <>>

Inheritance diagram for fawkes::TimeSourceAspect:

Public Member Functions

 TimeSourceAspect (TimeSource *timesource) __attribute__((nonnull))
 Constructor. More...
 
virtual ~TimeSourceAspect ()
 Virtual empty destructor. More...
 
TimeSourceget_timesource () const
 Get time source. More...
 
- Public Member Functions inherited from fawkes::Aspect
const std::list< const char * > & get_aspects () const
 Get list of aspect names attached to a aspected thread. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fawkes::Aspect
void add_aspect (const char *name)
 Add an aspect to a thread. More...
 

Detailed Description

Thread aspect that allows to provide a time source to the Fawkes clock.

There may be at most one external time source provided by a thread with the TimeSourceAspect at any given time. This is ensured by aspect initializer. This aspect can be used for example to attach Fawkes to a simulator and provide the simulated time to the system.

Author
Tim Niemueller

Definition at line 36 of file time_source.h.

Constructor & Destructor Documentation

◆ TimeSourceAspect()

fawkes::TimeSourceAspect::TimeSourceAspect ( TimeSource timesource)

Constructor.

Parameters
timesourcethe time source to provide to Fawkes

Definition at line 48 of file time_source.cpp.

References fawkes::Aspect::add_aspect().

◆ ~TimeSourceAspect()

fawkes::TimeSourceAspect::~TimeSourceAspect ( )
virtual

Virtual empty destructor.

Definition at line 55 of file time_source.cpp.

Member Function Documentation

◆ get_timesource()

TimeSource * fawkes::TimeSourceAspect::get_timesource ( ) const

Get time source.

This method is called by the aspect initializer to get the time source the thread with this aspect provides.

Returns
time source provided by the thread with this aspect

Definition at line 66 of file time_source.cpp.

Referenced by fawkes::TimeSourceAspectIniFin::finalize(), and fawkes::TimeSourceAspectIniFin::init().


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