FREEDM DGI
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
freedm::broker::CGlobalPeerList Class Reference

#include <CGlobalPeerList.hpp>

Inheritance diagram for freedm::broker::CGlobalPeerList:

Public Types

typedef std::map< std::string, CPeerNodePeerSet
 The peerset type. More...
 
typedef PeerSet::iterator PeerSetIterator
 Provides and Iterator. More...
 

Public Member Functions

PeerSetIterator begin ()
 Iterator to the beginning of the peerset. More...
 
int Count (const std::string &uuid)
 Count the number of peers with a specified uuid (should be 1 or 0) More...
 
CPeerNode Create (std::string uuid)
 Construct a peer. More...
 
PeerSetIterator end ()
 Iterator to the end of the peerset. More...
 
PeerSetIterator Find (const std::string &uuid)
 Return an iterator to the peer with the given uuid. More...
 
CPeerNode GetPeer (const std::string &uuid)
 Fetch a peer based on uuid, throws an exception if they aren't found. More...
 
void Insert (CPeerNode p)
 Pushes a peer node into the set. More...
 
PeerSetPeerList ()
 Returns a copy of the peer map. More...
 

Static Public Member Functions

static CGlobalPeerListinstance ()
 Provides the global instance. More...
 

Private Attributes

PeerSet m_peerlist
 The set of peers to present. More...
 

Friends

class freedm::broker::gm::GMAgent
 

Member Typedef Documentation

typedef std::map<std::string, CPeerNode> freedm::broker::CGlobalPeerList::PeerSet

Member Function Documentation

CGlobalPeerList::PeerSetIterator freedm::broker::CGlobalPeerList::begin ( )

CGlobalPeerList::begin

Description:
Return an iterator to the beginning of the container's table.
Returns
An iterator to the beginning of the peer list.
int freedm::broker::CGlobalPeerList::Count ( const std::string &  uuid)

CGlobalPeerList::Count

Description:
Count the number of peers with a specified uuid
Parameters
uuidThe UUID of a peer.
Returns
A count of all nodes with that uuid in the table. (should be 1 or 0)
CPeerNode freedm::broker::CGlobalPeerList::Create ( std::string  uuid)

CGlobalPeerList::Create

Description:
Adds a peer to the global peerlist by it's uuid
Precondition:
None
Postcondition:
If the peer is not already in the peerlist, it is inserted in the global peerlist.
Parameters
uuidThe UUID of a peer.
Returns
A CPeerNode for the given uuid.
CGlobalPeerList::PeerSetIterator freedm::broker::CGlobalPeerList::end ( )

CGlobalPeerList::end

Description:
Return an iterator to the end of the container's table.
Returns
An iterator to the end of the peer list.
CGlobalPeerList::PeerSetIterator freedm::broker::CGlobalPeerList::Find ( const std::string &  uuid)

CGlobalPeerList::Find

Description:
Return an iterator to the peer with the given uuid
Parameters
uuidThe UUID of the peer you are attempting to access
Returns
An iterator to the peer if found or end() if not found.
CPeerNode freedm::broker::CGlobalPeerList::GetPeer ( const std::string &  uuid)

CGlobalPeerList::GetPeer

Description:
Fetch a peer based on uuid, throws an exception if they aren't found
Parameters
uuidThe UUID of the peer you are attempting to get
Returns
A CPeerNode object for the specified peer.
Error Handling:
Runtime exception if no peer matches that description.
void freedm::broker::CGlobalPeerList::Insert ( CPeerNode  p)

CGlobalPeerList::Insert

Description:
Pushes a peer node into the set
Precondition:
None
Postcondition:
p has been added to the global peer list.
Parameters
pA CPeerNode to put into the container.
static CGlobalPeerList& freedm::broker::CGlobalPeerList::instance ( )
inlinestatic
CGlobalPeerList::PeerSet & freedm::broker::CGlobalPeerList::PeerList ( )

CGlobalPeerList::PeerList

Description:
Gets a copy of the global peer list.
Returns
A copy of the global peer list

Friends And Related Function Documentation

friend class freedm::broker::gm::GMAgent
friend

Member Data Documentation

PeerSet freedm::broker::CGlobalPeerList::m_peerlist
private

The documentation for this class was generated from the following files: