54 #ifndef _GAMS_GROUPS_GROUP_FIXED_LIST_H_
55 #define _GAMS_GROUPS_GROUP_FIXED_LIST_H_
61 #include "madara/knowledge/containers/StringVector.h"
84 madara::knowledge::KnowledgeBase * knowledge = 0);
130 virtual void write(
const std::string & prefix =
"",
131 madara::knowledge::KnowledgeBase * knowledge = 0)
const;
139 madara::knowledge::KnowledgeBase * knowledge = 0);
157 madara::knowledge::containers::StringVector
members_;
189 const std::string & prefix,
190 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 GroupFixedList groups.
virtual ~GroupFixedListFactory()
Destructor.
virtual GroupBase * create(const std::string &prefix, madara::knowledge::KnowledgeBase *knowledge)
Creates a group.
GroupFixedListFactory()
Constructor.
A fixed list of agent members.
GroupFixedList(const std::string &prefix="", madara::knowledge::KnowledgeBase *knowledge=0)
Constructor.
AgentVector fast_members_
member list for fast access
madara::knowledge::containers::StringVector members_
The source member list in the knowledge base.
virtual void clear_members(void)
Clears the member list.
virtual bool is_member(const std::string &id) const
Checks if the agent is a member of the formation.
virtual size_t size(void)
Returns the number of members in the group.
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 void add_members(const AgentVector &members)
Adds the members to the group.
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 remove_members(const AgentVector &members)
Removes members from the group.
virtual void sync(void)
Syncs the list to the knowledge base.
virtual void get_members(AgentVector &members) const
Retrieves the members from the group.
virtual ~GroupFixedList()
Constructor.
std::vector< std::string > AgentVector
A vector of agent names.
Contains all GAMS-related tools, classes and code.