Base class for a group of agents.
More...
#include <GroupBase.h>
|
| GroupBase (const std::string &prefix="", madara::knowledge::KnowledgeBase *knowledge=0) |
| Constructor. More...
|
|
virtual | ~GroupBase () |
| Constructor. More...
|
|
virtual void | add_members (const AgentVector &members)=0 |
| Adds the members to the group. More...
|
|
virtual void | clear_members (void)=0 |
| Clears the member list. More...
|
|
virtual void | get_members (AgentVector &members) const =0 |
| Retrieves the members from the group. More...
|
|
const std::string & | get_prefix (void) const |
| Gets the prefix for the group in the knowledge base. More...
|
|
virtual bool | is_member (const std::string &id) const =0 |
| Checks if the agent is a member of the formation. More...
|
|
virtual void | remove_members (const AgentVector &members)=0 |
| Removes members from the group. More...
|
|
virtual void | set_prefix (const std::string &prefix, madara::knowledge::KnowledgeBase *knowledge=0) |
| Sets the prefix for the group in the knowledge base. More...
|
|
virtual size_t | size (void)=0 |
| Returns the number of members in the group. More...
|
|
virtual void | sync (void)=0 |
| Syncs the list to the knowledge base. More...
|
|
virtual void | write (const std::string &prefix="", madara::knowledge::KnowledgeBase *knowledge=0) const =0 |
| Writes the group information to a specified prefix in a knowledge base. More...
|
|
Base class for a group of agents.
Definition at line 90 of file GroupBase.h.
◆ GroupBase()
gams::groups::GroupBase::GroupBase |
( |
const std::string & |
prefix = "" , |
|
|
madara::knowledge::KnowledgeBase * |
knowledge = 0 |
|
) |
| |
Constructor.
- Parameters
-
prefix | the name of the group(e.g. group.protectors) |
knowledge | the knowledge base to use for syncing |
◆ ~GroupBase()
virtual gams::groups::GroupBase::~GroupBase |
( |
| ) |
|
|
virtual |
◆ add_members()
virtual void gams::groups::GroupBase::add_members |
( |
const AgentVector & |
members | ) |
|
|
pure virtual |
◆ clear_members()
virtual void gams::groups::GroupBase::clear_members |
( |
void |
| ) |
|
|
pure virtual |
◆ get_members()
virtual void gams::groups::GroupBase::get_members |
( |
AgentVector & |
members | ) |
const |
|
pure virtual |
◆ get_prefix()
const std::string& gams::groups::GroupBase::get_prefix |
( |
void |
| ) |
const |
Gets the prefix for the group in the knowledge base.
- Returns
- the name of the group(e.g. group.protectors)
◆ is_member()
virtual bool gams::groups::GroupBase::is_member |
( |
const std::string & |
id | ) |
const |
|
pure virtual |
◆ remove_members()
virtual void gams::groups::GroupBase::remove_members |
( |
const AgentVector & |
members | ) |
|
|
pure virtual |
◆ set_prefix()
virtual void gams::groups::GroupBase::set_prefix |
( |
const std::string & |
prefix, |
|
|
madara::knowledge::KnowledgeBase * |
knowledge = 0 |
|
) |
| |
|
virtual |
◆ size()
virtual size_t gams::groups::GroupBase::size |
( |
void |
| ) |
|
|
pure virtual |
◆ sync()
virtual void gams::groups::GroupBase::sync |
( |
void |
| ) |
|
|
pure virtual |
◆ write()
virtual void gams::groups::GroupBase::write |
( |
const std::string & |
prefix = "" , |
|
|
madara::knowledge::KnowledgeBase * |
knowledge = 0 |
|
) |
| const |
|
pure virtual |
Writes the group information to a specified prefix in a knowledge base.
If no knowledge base is specified, then saves in the original knowledge base. If no prefix is specified, then saves in the original prefix location
- Parameters
-
prefix | the name of the group(e.g. group.protectors) |
knowledge | the knowledge base to save into |
Implemented in gams::groups::GroupTransient, and gams::groups::GroupFixedList.
◆ knowledge_
madara::knowledge::KnowledgeBase* gams::groups::GroupBase::knowledge_ |
|
mutableprotected |
The knowledge base to use as a data plane.
Definition at line 178 of file GroupBase.h.
◆ prefix_
std::string gams::groups::GroupBase::prefix_ |
|
protected |
The documentation for this class was generated from the following file: