10 : initialized_ (false), prefix_ (prefix),
11 heart_beat_ (heart_beat), last_clear_ (0)
39 std::vector <std::string> keys;
44 for (
size_t i = 0; i < keys.size (); ++i)
void keys(std::vector< std::string > &curkeys) const
Returns the keys within the map.
madara::knowledge::KnowledgeRecord::Integer Integer
std::vector< std::string > sync_keys(void)
Syncs the keys from the knowledge base.
Provides context about the transport.
void erase(const std::string &key)
Erases a variable from the map.
virtual void filter(knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context, knowledge::Variables &vars)
User-implementable method for performing a filter on network data.
int set(const std::string &key, madara::knowledge::KnowledgeRecord::Integer value=madara::knowledge::KnowledgeRecord::MODIFIED)
Sets a location within the map to the specified value.
knowledge::KnowledgeRecord::Integer heart_beat_
The time to keep record of a peer.
std::string prefix_
The context.
uint64_t get_current_time(void) const
Gets the current timestamp.
madara::knowledge::KnowledgeRecord::Integer Integer
void set_name(const std::string &var_name, KnowledgeBase &knowledge, bool sync=true)
Sets the variable name that this refers to.
::std::map< std::string, KnowledgeRecord > KnowledgeMap
PeerDiscovery(const std::string &prefix=".peers", knowledge::KnowledgeRecord::Integer heart_beat=-1)
Constructor.
knowledge::KnowledgeRecord::Integer last_clear_
The time of the last clear of the peer_list.
knowledge::containers::Map peers_
A map of discovered peers.
Provides utility functions and classes for common tasks and needs.
const std::string & get_originator(void) const
Returns the current message originator.
virtual ~PeerDiscovery()
Destructor.
Provides an interface for external functions into the MADARA KaRL variable settings.
bool initialized_
Tracks if the peers_ map has been initialized.