A very small encapsulating class, entirely in C++, tracks a number of assorted state information. Each member of the group, ni, uses one SRMinfo block for every other member of the group.
An SRMinfo object about group member nj at ni, contains information about the session messages received by ni from nj. ni can use this information to compute its distance to nj.
If nj sends is active in sending data traffic, then the SRMinfo object will also contain information about the received data, including a bit vector indicating all packets received from nj.
The agent keeps a list of SRMinfo objects, one per group member,
in its member variable, sip_.
Its method, [int sender]get_state
will return the object corresponding to that sender,
possibly creating that object, if it did not already exist.
The SRMinfo../ns-2/srm-state.h has two methods
to access and set the bit vector, ,
The session message variables to access timing information are public;
no encapsulating methods are provided. These are:
int lsess\_; /* # of last session msg received / int sendTime\_; /* Time sess. msg. # sent / int recvTime\_; /* Time sess. msg. # received / double distance\_; /* Data messages */ int ldata\_; /* # of last data msg sent /