OverSim
AddrPerOverlayVector Class Reference

#include <PeerStorage.h>

Inheritance diagram for AddrPerOverlayVector:
vector

Public Member Functions

 ~AddrPerOverlayVector ()
const
AddrPerOverlayVector::iterator 
getIterForOverlayId (int32_t overlayId)
TransportAddressgetAddrForOverlayId (int32_t overlayId)
void setAddrForOverlayId (TransportAddress *addr, int32_t overlayId)

Detailed Description

Definition at line 50 of file PeerStorage.h.

Constructor & Destructor Documentation

AddrPerOverlayVector::~AddrPerOverlayVector ( )
inline

Definition at line 53 of file PeerStorage.h.

{
for (iterator it = begin(); it != end(); it++) {
delete it->ta;
}
}

Member Function Documentation

TransportAddress* AddrPerOverlayVector::getAddrForOverlayId ( int32_t  overlayId)
inline

Definition at line 68 of file PeerStorage.h.

{
iterator it = getIterForOverlayId(overlayId);
if (it != end()) {
return it->ta;
}
return NULL;
};
const AddrPerOverlayVector::iterator AddrPerOverlayVector::getIterForOverlayId ( int32_t  overlayId)
inline

Definition at line 59 of file PeerStorage.h.

Referenced by getAddrForOverlayId().

{
iterator it;
for (it = begin(); it != end(); it++) {
if (it->overlayId == overlayId) return it;
}
return it;
};
void AddrPerOverlayVector::setAddrForOverlayId ( TransportAddress addr,
int32_t  overlayId 
)
inline

Definition at line 78 of file PeerStorage.h.

{
for (iterator it = begin(); it != end(); it++) {
if (it->overlayId == overlayId) {
delete it->ta;
it->ta = addr;
return;
}
}
apo.overlayId = overlayId;
apo.bootstrapped = false;
apo.ta = addr;
push_back(apo);
};

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