Fawkes API  Fawkes Development Version
BlackboardPlexilAdapter Class Reference

An interface adapter using standard POSIX time facilities to implement LookupNow and LookupOnChange. More...

#include <blackboard_adapter.h>

Inheritance diagram for BlackboardPlexilAdapter:

Public Member Functions

 BlackboardPlexilAdapter (PLEXIL::AdapterExecInterface &execInterface)
 Constructor. More...
 
 BlackboardPlexilAdapter (PLEXIL::AdapterExecInterface &execInterface, pugi::xml_node const xml)
 Constructor from configuration XML. More...
 
virtual ~BlackboardPlexilAdapter ()
 Destructor. 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 executeCommand (PLEXIL::Command *cmd)
 Perform given command. More...
 
- Public Member Functions inherited from fawkes::BlackBoardInterfaceListener
 BlackBoardInterfaceListener (const char *name_format,...)
 Constructor. More...
 
virtual ~BlackBoardInterfaceListener ()
 Destructor. More...
 
const char * bbil_name () const
 Get BBIL name. More...
 
virtual bool bb_interface_message_received (Interface *interface, Message *message) throw ()
 BlackBoard message received notification. More...
 
virtual void bb_interface_writer_added (Interface *interface, unsigned int instance_serial) throw ()
 A writing instance has been opened for a watched interface. More...
 
virtual void bb_interface_writer_removed (Interface *interface, unsigned int instance_serial) throw ()
 A writing instance has been closed for a watched interface. More...
 
virtual void bb_interface_reader_added (Interface *interface, unsigned int instance_serial) throw ()
 A reading instance has been opened for a watched interface. More...
 
virtual void bb_interface_reader_removed (Interface *interface, unsigned int instance_serial) throw ()
 A reading instance has been closed for a watched interface. More...
 

Additional Inherited Members

- Public Types inherited from fawkes::BlackBoardInterfaceListener
enum  QueueEntryType { DATA = 0, MESSAGES = 1, READER = 2, WRITER = 3 }
 Queue entry type. More...
 
typedef std::list< QueueEntryInterfaceQueue
 Queue of additions/removal of interfaces. More...
 
typedef std::map< std::string, Interface * > InterfaceMap
 Map of currently active event subscriptions. More...
 
- Protected Member Functions inherited from fawkes::BlackBoardInterfaceListener
void bbil_add_data_interface (Interface *interface)
 Add an interface to the data modification watch list. More...
 
void bbil_add_message_interface (Interface *interface)
 Add an interface to the message received watch list. More...
 
void bbil_add_reader_interface (Interface *interface)
 Add an interface to the reader addition/removal watch list. More...
 
void bbil_add_writer_interface (Interface *interface)
 Add an interface to the writer addition/removal watch list. More...
 
void bbil_remove_data_interface (Interface *interface)
 Remove an interface to the data modification watch list. More...
 
void bbil_remove_message_interface (Interface *interface)
 Remove an interface to the message received watch list. More...
 
void bbil_remove_reader_interface (Interface *interface)
 Remove an interface to the reader addition/removal watch list. More...
 
void bbil_remove_writer_interface (Interface *interface)
 Remove an interface to the writer addition/removal watch list. More...
 
Interfacebbil_data_interface (const char *iuid) throw ()
 Get interface instance for given UID. More...
 
Interfacebbil_message_interface (const char *iuid) throw ()
 Get interface instance for given UID. More...
 
Interfacebbil_reader_interface (const char *iuid) throw ()
 Get interface instance for given UID. More...
 
Interfacebbil_writer_interface (const char *iuid) throw ()
 Get interface instance for given UID. More...
 

Detailed Description

An interface adapter using standard POSIX time facilities to implement LookupNow and LookupOnChange.

Plexil adapter to provide access to Fawkes blackboard

Author
Tim Niemueller

Definition at line 43 of file blackboard_adapter.h.

Constructor & Destructor Documentation

◆ BlackboardPlexilAdapter() [1/2]

BlackboardPlexilAdapter::BlackboardPlexilAdapter ( PLEXIL::AdapterExecInterface &  execInterface)

Constructor.

Parameters
execInterfaceReference to the parent AdapterExecInterface object.

Definition at line 49 of file blackboard_adapter.cpp.

◆ BlackboardPlexilAdapter() [2/2]

BlackboardPlexilAdapter::BlackboardPlexilAdapter ( PLEXIL::AdapterExecInterface &  execInterface,
pugi::xml_node const  xml 
)

Constructor from configuration XML.

Parameters
execInterfaceReference to the parent AdapterExecInterface object.
xmlA const reference to the XML element describing this adapter
Note
The instance maintains a shared pointer to the XML.

Definition at line 59 of file blackboard_adapter.cpp.

◆ ~BlackboardPlexilAdapter()

BlackboardPlexilAdapter::~BlackboardPlexilAdapter ( )
virtual

Destructor.

Definition at line 66 of file blackboard_adapter.cpp.

Member Function Documentation

◆ executeCommand()

void BlackboardPlexilAdapter::executeCommand ( PLEXIL::Command *  cmd)
virtual

Perform given command.

Parameters
cmdcommand to execute

Definition at line 439 of file blackboard_adapter.cpp.

◆ initialize()

bool BlackboardPlexilAdapter::initialize ( )
virtual

Initialize adapter.

Returns
true if initialization was successful, false otherwise.

Definition at line 74 of file blackboard_adapter.cpp.

◆ lookupNow()

void BlackboardPlexilAdapter::lookupNow ( PLEXIL::State const &  state,
PLEXIL::StateCacheEntry &  cache_entry 
)
virtual

Immediate lookup of value.

Parameters
statestate variable to lookup
cache_entrycache entry for retrieved value

Definition at line 160 of file blackboard_adapter.cpp.

References fawkes::IFT_BOOL, fawkes::IFT_DOUBLE, fawkes::IFT_FLOAT, fawkes::IFT_INT16, fawkes::IFT_INT32, fawkes::IFT_INT64, fawkes::IFT_INT8, fawkes::IFT_UINT16, fawkes::IFT_UINT32, fawkes::IFT_UINT64, fawkes::IFT_UINT8, and fawkes::Logger::log_warn().

◆ reset()

bool BlackboardPlexilAdapter::reset ( void  )
virtual

Reset adapter.

Returns
true if successful, false otherwise.

Definition at line 133 of file blackboard_adapter.cpp.

◆ shutdown()

bool BlackboardPlexilAdapter::shutdown ( )
virtual

Shut adapter down.

Returns
true if successful, false otherwise.

Definition at line 142 of file blackboard_adapter.cpp.

References fawkes::BlackBoard::close(), and fawkes::BlackBoard::unregister_listener().

◆ start()

bool BlackboardPlexilAdapter::start ( )
virtual

Start adapter.

Returns
true if starting was successful, false otherwise.

Definition at line 115 of file blackboard_adapter.cpp.

◆ stop()

bool BlackboardPlexilAdapter::stop ( )
virtual

Stop adapter.

Returns
true if successful, false otherwise.

Definition at line 124 of file blackboard_adapter.cpp.

◆ subscribe()

void BlackboardPlexilAdapter::subscribe ( const PLEXIL::State &  state)
virtual

Subscribe to updates for given state.

Parameters
statestate variable to subscribe for

Definition at line 347 of file blackboard_adapter.cpp.

References fawkes::BlackBoardInterfaceListener::bbil_add_data_interface(), fawkes::Logger::log_error(), fawkes::Logger::log_warn(), and fawkes::BlackBoard::update_listener().

◆ unsubscribe()

void BlackboardPlexilAdapter::unsubscribe ( const PLEXIL::State &  state)
virtual

Unsubscribe from updates.

Parameters
statestate variable to unsubscribe from

Definition at line 379 of file blackboard_adapter.cpp.

References fawkes::BlackBoardInterfaceListener::bbil_remove_data_interface(), fawkes::Logger::log_error(), fawkes::Logger::log_warn(), and fawkes::BlackBoard::update_listener().


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