56 #ifndef _GAMS_GROUPS_GROUP_TRANSIENT_H_
57 #define _GAMS_GROUPS_GROUP_TRANSIENT_H_
63 #include "madara/knowledge/containers/Map.h"
86 madara::knowledge::KnowledgeBase * knowledge = 0);
132 virtual void write(
const std::string & prefix =
"",
133 madara::knowledge::KnowledgeBase * knowledge = 0)
const;
141 madara::knowledge::KnowledgeBase * knowledge = 0);
191 const std::string & prefix,
192 madara::knowledge::KnowledgeBase * knowledge);
Copyright(c) 2016 Carnegie Mellon University.
Copyright(c) 2016 Carnegie Mellon University.
Base class for a group of agents.
Base class for a group factory.
Factory for creating GroupTransient groups.
GroupTransientFactory()
Constructor.
virtual GroupBase * create(const std::string &prefix, madara::knowledge::KnowledgeBase *knowledge)
Creates a group.
virtual ~GroupTransientFactory()
Destructor.
A fixed list of agent members.
madara::knowledge::containers::Map members_
The source member list in the knowledge base.
virtual void write(const std::string &prefix="", madara::knowledge::KnowledgeBase *knowledge=0) const
Writes the group information to a specified prefix in a knowledge base.
virtual ~GroupTransient()
Constructor.
virtual size_t size(void)
Returns the number of members in the group.
virtual void sync(void)
Syncs the list to the knowledge base.
virtual void add_members(const AgentVector &members)
Adds the members to the group.
AgentMap fast_members_
member list for fast access
virtual void remove_members(const AgentVector &members)
Removes members from the group.
GroupTransient(const std::string &prefix="", madara::knowledge::KnowledgeBase *knowledge=0)
Constructor.
virtual void set_prefix(const std::string &prefix, madara::knowledge::KnowledgeBase *knowledge=0)
Sets the prefix for the group in the knowledge base.
virtual void get_members(AgentVector &members) const
Retrieves the members from the group.
virtual bool is_member(const std::string &id) const
Checks if the agent is a member of the formation.
virtual void clear_members(void)
Clears the member list.
std::vector< std::string > AgentVector
A vector of agent names.
std::map< std::string, madara::knowledge::KnowledgeRecord::Integer > AgentMap
A map of agent names.
Contains all GAMS-related tools, classes and code.