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()
virtual void unsubscribe(const PLEXIL::State &state)
Unsubscribe from updates.
double in_sec() const
Convet time to seconds.
double getCurrentTime()
Get the current time from the operating system.
A class for handling time.
virtual void subscribe(const PLEXIL::State &state)
Subscribe to updates for given state.
ClockPlexilTimeAdapter(PLEXIL::AdapterExecInterface &execInterface)
Constructor.
virtual bool start()
Start adapter.
An interface adapter using standard POSIX time facilities to implement LookupNow and LookupOnChange.
virtual ~ClockPlexilTimeAdapter()
Destructor.
virtual bool initialize()
Initialize adapter.
virtual void timer_event()
Called for timer events.
void cancel()
Cancel a thread.
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.
void join()
Join the thread.
void start_timer(CallbackListener *listener, const fawkes::Time &wait_until)
Start timer non-blocking.
virtual void lookupNow(PLEXIL::State const &state, PLEXIL::StateCacheEntry &cacheEntry)
Immediate lookup of value.
virtual bool stop()
Stop adapter.
void abort_timer()
Abort a currently running timer.