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_;
Thread to synchronize two BlackBoards.
virtual void init()
Initialize the thread.
virtual void run()
Stub to see name in backtrace for easier debugging.
void writer_added(fawkes::Interface *interface)
A writer has been added for an interface.
virtual void finalize()
Finalize the thread.
virtual void loop()
Code to execute in the thread.
virtual ~BlackBoardSynchronizationThread()
Destructor.
void writer_removed(fawkes::Interface *interface)
A writer has been removed for an interface.
BlackBoardSynchronizationThread(std::string &bbsync_cfg_prefix, std::string &peer_cfg_prefix, std::string &peer)
Constructor.
InterfaceInfo representation for JSON transfer.
std::optional< std::string > writer() const
Get writer value.
Listener for writer events in bbsync plugin.
Thread aspect to access to BlackBoard.
The BlackBoard abstract class.
Thread aspect that allows to obtain the current time from the clock.
Thread aspect to access configuration data.
Base class for all Fawkes BlackBoard interfaces.
Thread aspect to log output.
Thread class encapsulation of pthreads.
Fawkes library namespace.