23 #ifndef _PLUGINS_BBSYNC_SYNC_THREAD_H_ 24 #define _PLUGINS_BBSYNC_SYNC_THREAD_H_ 26 #include "sync_listener.h" 27 #include "writer_listener.h" 29 #include <aspect/blackboard.h> 30 #include <aspect/clock.h> 31 #include <aspect/configurable.h> 32 #include <aspect/logging.h> 33 #include <core/threading/thread.h> 34 #include <core/utils/lock_map.h> 52 std::string &peer_cfg_prefix,
76 std::string reader_id;
77 std::string writer_id;
94 InterfaceInfo() : combo(NULL), writer(NULL), reader_bb(NULL), writer_bb(NULL)
108 : combo(pcombo), writer(pwriter), reader_bb(preader_bb), writer_bb(pwriter_bb)
116 : combo(ii.combo), writer(ii.writer), reader_bb(ii.reader_bb), writer_bb(ii.writer_bb)
129 reader_bb = ii.reader_bb;
130 writer_bb = ii.writer_bb;
135 typedef std::map<std::string, combo_t> ComboMap;
139 bool check_connection();
140 void read_config_combos(std::string prefix,
bool writing);
141 void open_interfaces();
142 void close_interfaces();
145 std::string bbsync_cfg_prefix_;
146 std::string peer_cfg_prefix_;
159 InterfaceMap interfaces_;
161 SyncListenerMap sync_listeners_;
virtual void finalize()
Finalize the thread.
Thread aspect to access to BlackBoard.
Thread aspect that allows to obtain the current time from the clock.
virtual ~BlackBoardSynchronizationThread()
Destructor.
Fawkes library namespace.
virtual void init()
Initialize the thread.
virtual void run()
Stub to see name in backtrace for easier debugging.
Thread class encapsulation of pthreads.
Base class for all Fawkes BlackBoard interfaces.
std::optional< std::string > writer() const
Get writer value.
BlackBoardSynchronizationThread(std::string &bbsync_cfg_prefix, std::string &peer_cfg_prefix, std::string &peer)
Constructor.
Thread aspect to log output.
Thread to synchronize two BlackBoards.
Thread aspect to access configuration data.
Listener for writer events in bbsync plugin.
InterfaceInfo representation for JSON transfer.
void writer_added(fawkes::Interface *interface)
A writer has been added for an interface.
void writer_removed(fawkes::Interface *interface)
A writer has been removed for an interface.
The BlackBoard abstract class.
virtual void loop()
Code to execute in the thread.