Fawkes API
Fawkes Development Version
|
23 #include "clock_adapter.h"
25 #include <AdapterConfiguration.hh>
26 #include <AdapterExecInterface.hh>
27 #include <AdapterFactory.hh>
29 #include <StateCacheEntry.hh>
40 : TimeAdapter(execInterface)
50 pugi::xml_node
const xml)
51 : TimeAdapter(execInterface, xml)
67 PLEXIL::g_configuration->registerLookupInterface(
"time",
this);
77 clock_ =
reinterpret_cast<fawkes::Clock *
>(m_execInterface.getProperty(
"::Fawkes::Clock"));
124 if (state != PLEXIL::State::timeState()) {
126 cache_entry.setUnknown();
159 if (state != PLEXIL::State::timeState()) {
166 warn(
"FawkesTimeAdapter:setThresholds: timeout already passed");
187 m_execInterface.notifyOfExternalEvent();
202 initFawkesTimeAdapter()
ClockPlexilTimeAdapter(PLEXIL::AdapterExecInterface &execInterface)
Constructor.
virtual ~ClockPlexilTimeAdapter()
Destructor.
virtual void lookupNow(PLEXIL::State const &state, PLEXIL::StateCacheEntry &cacheEntry)
Immediate lookup of value.
virtual bool stop()
Stop adapter.
virtual void timer_event()
Called for timer events.
virtual void setThresholds(const PLEXIL::State &state, double hi, double lo)
Set thresholds for subscription.
virtual bool reset()
Reset adapter.
virtual bool shutdown()
Shut adapter down.
virtual void unsubscribe(const PLEXIL::State &state)
Unsubscribe from updates.
A class for handling time.
void start_timer(CallbackListener *listener, const fawkes::Time &wait_until)
Start timer non-blocking.
void start(bool wait=true)
Call this method to start the thread.
virtual bool initialize()
Initialize adapter.
void cancel()
Cancel a thread.
double in_sec() const
Convet time to seconds.
virtual void subscribe(const PLEXIL::State &state)
Subscribe to updates for given state.
void abort_timer()
Abort a currently running timer.
double getCurrentTime()
Get the current time from the operating system.
This is supposed to be the central clock in Fawkes.
void join()
Join the thread.
An interface adapter using standard POSIX time facilities to implement LookupNow and LookupOnChange.
virtual bool start()
Start adapter.