OverSim
|
Capsulates the informations of a scribe multicast group. More...
#include <ScribeGroup.h>
Public Member Functions | |
ScribeGroup (OverlayKey id) | |
Creates a new ScribeGroup. | |
~ScribeGroup () | |
std::pair< std::set < NodeHandle >::iterator, bool > | addChild (const NodeHandle &node) |
Adds a new child to the multicast tree. | |
void | removeChild (const NodeHandle &node) |
Removes a child from the multicast tree. | |
std::set< NodeHandle >::iterator | getChildrenBegin () |
Returns an iterator to the begin of the children list. | |
std::set< NodeHandle >::iterator | getChildrenEnd () |
Returns an iterator to the end of the children list. | |
int | numChildren () const |
Get the number of children. | |
bool | isForwarder () const |
Return whether the node is forwarder for a group. | |
bool | getAmISource () const |
Returns the amISource status. | |
void | setAmISource (bool source) |
Set the amISource status. | |
bool | getSubscription () const |
Returns whether the local node is subscriber of the group. | |
void | setSubscription (bool subscribe) |
Set the subscription status. | |
NodeHandle | getParent () const |
Return the parent in the multicast tree. | |
void | setParent (NodeHandle &_parent) |
Sets a new parent for the multicast tree. | |
NodeHandle | getRendezvousPoint () const |
Returns the rendevouzPoint (root) of the multicast tree for the group. | |
void | setRendezvousPoint (const NodeHandle &_rendezvousPoint) |
Sets the rendevouzPoint (root) of the multicast tree for the group. | |
OverlayKey | getGroupId () const |
Returns the groupId of the group. | |
ScribeTimer * | getParentTimer () |
Returns the parent timer. | |
void | setParentTimer (ScribeTimer *t) |
Sets the parent timer. | |
ScribeTimer * | getHeartbeatTimer () |
Returns the heartbeat timer. | |
void | setHeartbeatTimer (ScribeTimer *t) |
Sets the heartbeat timer. | |
bool | operator== (const OverlayKey &id) const |
Checks whether the group has a certain groupId. | |
bool | operator== (const ScribeGroup &a) const |
Checks whether two groups have the same ID. | |
bool | operator< (const OverlayKey &id) const |
Checks whether the group has a smaller ID than the given key. | |
bool | operator< (const ScribeGroup &a) const |
Checks whether the group has a smaller ID than another group. |
Private Attributes | |
OverlayKey | groupId |
NodeHandle | rendezvousPoint |
NodeHandle | parent |
std::set< NodeHandle > | children |
bool | subscription |
bool | amISource |
ScribeTimer * | parentTimer |
ScribeTimer * | heartbeatTimer |
Capsulates the informations of a scribe multicast group.
Definition at line 40 of file ScribeGroup.h.
ScribeGroup::ScribeGroup | ( | OverlayKey | id | ) |
Creates a new ScribeGroup.
id | The group ID of the new group |
Definition at line 29 of file ScribeGroup.cc.
ScribeGroup::~ScribeGroup | ( | ) |
Definition at line 39 of file ScribeGroup.cc.
std::pair< std::set< NodeHandle >::iterator, bool > ScribeGroup::addChild | ( | const NodeHandle & | node | ) |
Adds a new child to the multicast tree.
node | The nodeHandle of the child |
Definition at line 49 of file ScribeGroup.cc.
Referenced by Scribe::addChildToGroup().
|
inline |
Returns the amISource status.
This status indicates if the node is a source of the multicastgroup FIXME: currently the flag is only be set to true if the node is not also a member (i.e. subscriber) of the group
Definition at line 114 of file ScribeGroup.h.
Referenced by Scribe::checkGroupEmpty().
std::set< NodeHandle >::iterator ScribeGroup::getChildrenBegin | ( | ) |
Returns an iterator to the begin of the children list.
Definition at line 60 of file ScribeGroup.cc.
std::set< NodeHandle >::iterator ScribeGroup::getChildrenEnd | ( | ) |
Returns an iterator to the end of the children list.
Definition at line 65 of file ScribeGroup.cc.
|
inline |
Returns the groupId of the group.
Definition at line 174 of file ScribeGroup.h.
Referenced by Scribe::addChildToGroup(), Scribe::checkGroupEmpty(), operator<(), and operator==().
|
inline |
Returns the heartbeat timer.
If the timer expires, the node is supposed to send heartbeat messages to all children.
Definition at line 204 of file ScribeGroup.h.
Referenced by Scribe::checkGroupEmpty().
|
inline |
Return the parent in the multicast tree.
Definition at line 146 of file ScribeGroup.h.
Referenced by Scribe::checkGroupEmpty().
|
inline |
Returns the parent timer.
The parent timer is supposed to expire if the parent fails to send heartbeat messages.
Definition at line 184 of file ScribeGroup.h.
Referenced by Scribe::checkGroupEmpty().
|
inline |
Returns the rendevouzPoint (root) of the multicast tree for the group.
Definition at line 160 of file ScribeGroup.h.
|
inline |
Returns whether the local node is subscriber of the group.
Definition at line 132 of file ScribeGroup.h.
Referenced by Scribe::checkGroupEmpty().
bool ScribeGroup::isForwarder | ( | ) | const |
Return whether the node is forwarder for a group.
Definition at line 44 of file ScribeGroup.cc.
Referenced by Scribe::checkGroupEmpty().
|
inline |
Get the number of children.
Definition at line 96 of file ScribeGroup.h.
|
inline |
Checks whether the group has a smaller ID than the given key.
id | The key to compare |
Definition at line 238 of file ScribeGroup.h.
|
inline |
Checks whether the group has a smaller ID than another group.
a | the group to compare |
Definition at line 246 of file ScribeGroup.h.
|
inline |
Checks whether the group has a certain groupId.
id | The groupId to check |
Definition at line 222 of file ScribeGroup.h.
|
inline |
Checks whether two groups have the same ID.
a | The group to compare |
Definition at line 230 of file ScribeGroup.h.
void ScribeGroup::removeChild | ( | const NodeHandle & | node | ) |
Removes a child from the multicast tree.
node | The nodeHandle of the child |
Definition at line 54 of file ScribeGroup.cc.
Referenced by Scribe::removeChildFromGroup().
|
inline |
Set the amISource status.
This status indicates if the node is a source of the multicastgroup FIXME: currently the flag is only be set to true if the node is not also a member (i.e. subscriber) of the group
source | True if the node is sending in multicast messages to the group |
Definition at line 125 of file ScribeGroup.h.
|
inline |
Sets the heartbeat timer.
If the timer expires, the node is supposed to send heartbeat messages to all children.
t | The heartbeatTimer |
Definition at line 214 of file ScribeGroup.h.
|
inline |
Sets a new parent for the multicast tree.
_parent | The new Parent. Set to thisNode if node should be root of the tree |
Definition at line 153 of file ScribeGroup.h.
|
inline |
Sets the parent timer.
The parent timer is supposed to expire if the parent fails to send heartbeat messages.
t | The parentTimer |
Definition at line 194 of file ScribeGroup.h.
|
inline |
Sets the rendevouzPoint (root) of the multicast tree for the group.
_rendezvousPoint | The root of the tree |
Definition at line 167 of file ScribeGroup.h.
|
inline |
Set the subscription status.
subscribe | True if the node is interested in multicast messages for the group, false else |
Definition at line 139 of file ScribeGroup.h.
|
private |
Definition at line 48 of file ScribeGroup.h.
Referenced by getAmISource(), ScribeGroup(), and setAmISource().
|
private |
Definition at line 46 of file ScribeGroup.h.
Referenced by addChild(), getChildrenBegin(), getChildrenEnd(), isForwarder(), numChildren(), removeChild(), and ~ScribeGroup().
|
private |
Definition at line 43 of file ScribeGroup.h.
Referenced by getGroupId(), operator<(), and operator==().
|
private |
Definition at line 51 of file ScribeGroup.h.
Referenced by getHeartbeatTimer(), ScribeGroup(), and setHeartbeatTimer().
|
private |
Definition at line 45 of file ScribeGroup.h.
Referenced by getParent(), ScribeGroup(), and setParent().
|
private |
Definition at line 50 of file ScribeGroup.h.
Referenced by getParentTimer(), ScribeGroup(), and setParentTimer().
|
private |
Definition at line 44 of file ScribeGroup.h.
Referenced by getRendezvousPoint(), ScribeGroup(), and setRendezvousPoint().
|
private |
Definition at line 47 of file ScribeGroup.h.
Referenced by getSubscription(), ScribeGroup(), and setSubscription().