23 #include "bbsync_plugin.h" 24 #include "sync_thread.h" 44 std::set<std::string> peers;
45 std::set<std::string> ignored_peers;
47 std::string prefix =
"/fawkes/bbsync/";
48 std::string peers_prefix = prefix +
"peers/";
52 std::string peer = std::string(i->
path()).substr(peers_prefix.length());
53 peer = peer.substr(0, peer.find(
"/"));
55 if ( (peers.find(peer) == peers.end()) &&
56 (ignored_peers.find(peer) == ignored_peers.end()) ) {
58 std::string peer_prefix = peers_prefix + peer +
"/";
62 active = config->
get_bool((peer_prefix +
"active").c_str());
73 ignored_peers.insert(peer);
80 throw Exception(
"No synchronization peers configured, aborting");
85 PLUGIN_DESCRIPTION(
"Synchronize with remote Fawkes BlackBoards")
Fawkes library namespace.
virtual bool get_bool(const char *path)=0
Get value from configuration which is of type bool.
BlackBoardSynchronizationPlugin(fawkes::Configuration *config)
Constructor.
virtual ValueIterator * search(const char *path)=0
Iterator with search results.
virtual bool next()=0
Check if there is another element and advance to this if possible.
BlackBoard synchronization plugin.
Base class for exceptions in Fawkes.
ThreadList thread_list
Thread list member.
virtual const char * path() const =0
Path of value.
Thread to synchronize two BlackBoards.
void push_back(Thread *thread)
Add thread to the end.
Iterator interface to iterate over config values.
Interface for configuration handling.