A fixed list of agent members.
More...
#include <GroupTransient.h>
|
| GroupTransient (const std::string &prefix="", madara::knowledge::KnowledgeBase *knowledge=0) |
| Constructor. More...
|
|
virtual | ~GroupTransient () |
| Constructor. More...
|
|
virtual void | add_members (const AgentVector &members) |
| Adds the members to the group. More...
|
|
virtual void | clear_members (void) |
| Clears the member list. More...
|
|
virtual void | get_members (AgentVector &members) const |
| 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 |
| Checks if the agent is a member of the formation. More...
|
|
virtual void | remove_members (const AgentVector &members) |
| 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) |
| Returns the number of members in the group. More...
|
|
virtual void | sync (void) |
| Syncs the list to the knowledge base. More...
|
|
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. More...
|
|
A fixed list of agent members.
Definition at line 75 of file GroupTransient.h.
◆ GroupTransient()
gams::groups::GroupTransient::GroupTransient |
( |
const std::string & |
prefix = "" , |
|
|
madara::knowledge::KnowledgeBase * |
knowledge = 0 |
|
) |
| |
Constructor.
Note that if you do not specify prefix and knowledge base, then you are essentially just working with a local group with no connection to other agents.
- Parameters
-
prefix | the name of the group(e.g. group.protectors) |
knowledge | the knowledge base to use for syncing |
◆ ~GroupTransient()
virtual gams::groups::GroupTransient::~GroupTransient |
( |
| ) |
|
|
virtual |
◆ add_members()
virtual void gams::groups::GroupTransient::add_members |
( |
const AgentVector & |
members | ) |
|
|
virtual |
Adds the members to the group.
- Parameters
-
members | list of members to add to formation |
Implements gams::groups::GroupBase.
◆ clear_members()
virtual void gams::groups::GroupTransient::clear_members |
( |
void |
| ) |
|
|
virtual |
◆ get_members()
virtual void gams::groups::GroupTransient::get_members |
( |
AgentVector & |
members | ) |
const |
|
virtual |
Retrieves the members from the group.
- Parameters
-
members | a list of the members currently in the group |
Implements gams::groups::GroupBase.
◆ get_prefix()
const std::string& gams::groups::GroupBase::get_prefix |
( |
void |
| ) |
const |
|
inherited |
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::GroupTransient::is_member |
( |
const std::string & |
id | ) |
const |
|
virtual |
Checks if the agent is a member of the formation.
- Parameters
-
id | the agent id(e.g. agent.0 or agent.leader). If null, uses the current agent's id |
- Returns
- true if the agent is a member of the group
Implements gams::groups::GroupBase.
◆ remove_members()
virtual void gams::groups::GroupTransient::remove_members |
( |
const AgentVector & |
members | ) |
|
|
virtual |
Removes members from the group.
- Parameters
-
members | list of members to remove if they exist |
Implements gams::groups::GroupBase.
◆ set_prefix()
virtual void gams::groups::GroupTransient::set_prefix |
( |
const std::string & |
prefix, |
|
|
madara::knowledge::KnowledgeBase * |
knowledge = 0 |
|
) |
| |
|
virtual |
Sets the prefix for the group in the knowledge base.
- Parameters
-
prefix | the name of the group(e.g. group.protectors) |
knowledge | the knowledge base to use for syncing |
Reimplemented from gams::groups::GroupBase.
◆ size()
virtual size_t gams::groups::GroupTransient::size |
( |
void |
| ) |
|
|
virtual |
◆ sync()
virtual void gams::groups::GroupTransient::sync |
( |
void |
| ) |
|
|
virtual |
◆ write()
virtual void gams::groups::GroupTransient::write |
( |
const std::string & |
prefix = "" , |
|
|
madara::knowledge::KnowledgeBase * |
knowledge = 0 |
|
) |
| const |
|
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 |
Implements gams::groups::GroupBase.
◆ fast_members_
AgentMap gams::groups::GroupTransient::fast_members_ |
|
protected |
◆ knowledge_
madara::knowledge::KnowledgeBase* gams::groups::GroupBase::knowledge_ |
|
mutableprotectedinherited |
The knowledge base to use as a data plane.
Definition at line 178 of file GroupBase.h.
◆ members_
madara::knowledge::containers::Map gams::groups::GroupTransient::members_ |
|
protected |
◆ prefix_
std::string gams::groups::GroupBase::prefix_ |
|
protectedinherited |
The documentation for this class was generated from the following file: