gPTP Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PeerList Class Reference

#include <PeerList.hpp>

Inheritance diagram for PeerList:
Inheritance graph
Collaboration diagram for PeerList:
Collaboration graph

Public Types

typedef PeerVector::const_iterator const_iterator
 
typedef PeerVector::iterator PeerVectorIt
 

Public Member Functions

 PeerList ()
 
PeerVectorIt find (PeerAddr addr, bool *found)
 Look for a peer address. More...
 
bool add (PeerAddr addr)
 Add a new peer address. More...
 
bool remove (PeerAddr addr)
 Remove a peer address from the internal list. More...
 
const_iterator begin ()
 Gets the beginning of the sequence container. More...
 
const_iterator end ()
 Gets the end of the sequence container. More...
 
void setInit (peer_init_handler init, void *init_arg)
 Sets init handler. More...
 
void setRm (peer_rm_handler rm)
 Sets peer remove callback on the PeerList object. More...
 
bool IsReady ()
 Gets ready flag. More...
 
void setReady (bool ready)
 Sets ready flag. More...
 
- Public Member Functions inherited from Lockable
 Lockable ()
 
void get ()
 Acquires lock. More...
 
void put ()
 Releases lock. More...
 

Detailed Description

Peer List interface

Member Typedef Documentation

typedef PeerVector::const_iterator PeerList::const_iterator

Peer constant iterator

typedef PeerVector::iterator PeerList::PeerVectorIt

Peer vector iterator

Constructor & Destructor Documentation

PeerList::PeerList ( )
inline

Initializes peer list

Member Function Documentation

bool PeerList::add ( PeerAddr  addr)
inline

Add a new peer address.

Parameters
addrPeerAddr address
Returns
TRUE if successfully added. FALSE if it already exists
const_iterator PeerList::begin ( )
inline

Gets the beginning of the sequence container.

Returns
An iterator to the beginning of the sequence container
const_iterator PeerList::end ( )
inline

Gets the end of the sequence container.

Returns
An iterator to the end of the sequence container
PeerVectorIt PeerList::find ( PeerAddr  addr,
bool *  found 
)
inline

Look for a peer address.

Parameters
addrPeer address
found[out] Set to true when address is found
Returns
PeerVector internal
bool PeerList::IsReady ( )
inline

Gets ready flag.

Returns
TRUE if ready. FALSE otherwise
bool PeerList::remove ( PeerAddr  addr)
inline

Remove a peer address from the internal list.

Parameters
addrAddress to remove
Returns
FALSE if the address is not found. TRUE if successfully removed.
void PeerList::setInit ( peer_init_handler  init,
void *  init_arg 
)
inline

Sets init handler.

Parameters
initPeer init handler
init_arg[in] Init arguments
Returns
void
void PeerList::setReady ( bool  ready)
inline

Sets ready flag.

Parameters
readyFlag value to be set
Returns
void
void PeerList::setRm ( peer_rm_handler  rm)
inline

Sets peer remove callback on the PeerList object.

Parameters
rmrm handler
Returns
void

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