Fawkes API
Fawkes Development Version
|
An interface adapter using standard POSIX time facilities to implement LookupNow and LookupOnChange. More...
#include <clock_adapter.h>
Public Member Functions | |
ClockPlexilTimeAdapter (PLEXIL::AdapterExecInterface &execInterface) | |
Constructor. More... | |
ClockPlexilTimeAdapter (PLEXIL::AdapterExecInterface &execInterface, pugi::xml_node const xml) | |
Constructor from configuration XML. More... | |
virtual | ~ClockPlexilTimeAdapter () |
Destructor. More... | |
double | getCurrentTime () throw (PLEXIL::InterfaceError) |
Get the current time from the operating system. More... | |
virtual bool | initialize () |
Initialize adapter. More... | |
virtual bool | start () |
Start adapter. More... | |
virtual bool | stop () |
Stop adapter. More... | |
virtual bool | reset () |
Reset adapter. More... | |
virtual bool | shutdown () |
Shut adapter down. More... | |
virtual void | lookupNow (PLEXIL::State const &state, PLEXIL::StateCacheEntry &cacheEntry) |
Immediate lookup of value. More... | |
virtual void | subscribe (const PLEXIL::State &state) |
Subscribe to updates for given state. More... | |
virtual void | unsubscribe (const PLEXIL::State &state) |
Unsubscribe from updates. More... | |
virtual void | setThresholds (const PLEXIL::State &state, double hi, double lo) |
Set thresholds for subscription. More... | |
virtual void | setThresholds (const PLEXIL::State &state, int32_t hi, int32_t lo) |
Set thresholds for subscription. More... | |
virtual void | timer_event () |
Called for timer events. More... | |
An interface adapter using standard POSIX time facilities to implement LookupNow and LookupOnChange.
Plexil adapter to provide time from Fawkes time source.
Definition at line 36 of file clock_adapter.h.
ClockPlexilTimeAdapter::ClockPlexilTimeAdapter | ( | PLEXIL::AdapterExecInterface & | execInterface | ) |
Constructor.
execInterface | Reference to the parent AdapterExecInterface object. |
Definition at line 39 of file clock_adapter.cpp.
ClockPlexilTimeAdapter::ClockPlexilTimeAdapter | ( | PLEXIL::AdapterExecInterface & | execInterface, |
pugi::xml_node const | xml | ||
) |
Constructor from configuration XML.
execInterface | Reference to the parent AdapterExecInterface object. |
xml | A const reference to the XML element describing this adapter |
Definition at line 49 of file clock_adapter.cpp.
|
virtual |
Destructor.
Definition at line 56 of file clock_adapter.cpp.
double ClockPlexilTimeAdapter::getCurrentTime | ( | ) | ||
throw | ( | PLEXIL::InterfaceError | ||
) |
Get the current time from the operating system.
Definition at line 194 of file clock_adapter.cpp.
References fawkes::Time::in_sec().
Referenced by lookupNow().
|
virtual |
Initialize adapter.
Definition at line 64 of file clock_adapter.cpp.
|
virtual |
Immediate lookup of value.
state | state variable to lookup |
cache_entry | cache entry for retrieved value |
Definition at line 122 of file clock_adapter.cpp.
References getCurrentTime().
|
virtual |
Reset adapter.
Definition at line 103 of file clock_adapter.cpp.
|
virtual |
Set thresholds for subscription.
state | state variable |
hi | high value |
lo | low value |
Definition at line 157 of file clock_adapter.cpp.
References fawkes::Time::in_sec(), PlexilTimerThread::start_timer(), and timer_event().
Referenced by setThresholds().
|
virtual |
Set thresholds for subscription.
state | state variable |
hi | high value |
lo | low value |
Definition at line 179 of file clock_adapter.cpp.
References setThresholds().
|
virtual |
Shut adapter down.
Definition at line 112 of file clock_adapter.cpp.
|
virtual |
Start adapter.
Definition at line 75 of file clock_adapter.cpp.
|
virtual |
Stop adapter.
Definition at line 89 of file clock_adapter.cpp.
References PlexilTimerThread::abort_timer(), fawkes::Thread::cancel(), and fawkes::Thread::join().
|
virtual |
Subscribe to updates for given state.
state | state variable to subscribe for |
Definition at line 137 of file clock_adapter.cpp.
|
virtual |
Called for timer events.
Implements PlexilTimerThread::CallbackListener.
Definition at line 185 of file clock_adapter.cpp.
Referenced by setThresholds().
|
virtual |
Unsubscribe from updates.
state | state variable to unsubscribe from |
Definition at line 146 of file clock_adapter.cpp.
References PlexilTimerThread::abort_timer().