protlib::ConnectionMap Class Reference
[TP over TCP]

#include <source/ariba/utility/transport/tcpip/protlib/connectionmap.h>

List of all members.

Public Types

typedef const_ass2data_it_t const_it_t
 connection map iterator

Public Member Functions

bool erase (AssocData *assoc)
 Erase the AssocData-element.
size_t get_size () const
 get number of records
const_it_t begin () const
const_it_t end () const
bool insert (AssocData *assoc)
 Insert a new AssocData element into the ConnectionMap.
AssocDatalookup (socketfd_t socketfd) const
 Search for existing connections to this specific socket.
AssocDatalookup (associd_t associd) const
 Search for existing connections to this specific assoc id.
AssocDatalookup (const appladdress &addr) const
 Search for existing connections to this address.
bool erase (socketfd_t socketfd)
 Erase the AssocData-element associated with this socket.
bool erase (associd_t associd)
 Erase the AssocData-element associated with this socket.
void clear ()
 clear all

Private Types

typedef hash_map< socketfd_t,AssocData * > ass2data_t
typedef ass2data_t::const_iterator const_ass2data_it_t
typedef hash_map< appladdress,
AssocData * > 
addr2data_t
typedef addr2data_t::const_iterator const_addr2data_it_t

Private Attributes

ass2data_t ass2data
 map: socket fd to association data
addr2data_t addr2data
 map: (application) address to association data


Detailed Description

The class ConnectionMap saves all required information about currently existing connections. Its methods allow to check for connections and return, if possible, the data associated with the connection.

Definition at line 42 of file connectionmap.h.


Member Typedef Documentation

Definition at line 69 of file connectionmap.h.

Definition at line 67 of file connectionmap.h.

typedef addr2data_t::const_iterator protlib::ConnectionMap::const_addr2data_it_t [private]

Definition at line 70 of file connectionmap.h.

typedef ass2data_t::const_iterator protlib::ConnectionMap::const_ass2data_it_t [private]

Definition at line 68 of file connectionmap.h.

connection map iterator

Definition at line 77 of file connectionmap.h.


Member Function Documentation

ConnectionMap::const_it_t protlib::ConnectionMap::begin (  )  const [inline]

Definition at line 87 of file connectionmap.h.

References ass2data.

void protlib::ConnectionMap::clear (  ) 

clear all

Definition at line 142 of file connectionmap.cpp.

References addr2data, and ass2data.

ConnectionMap::const_it_t protlib::ConnectionMap::end (  )  const [inline]

Definition at line 92 of file connectionmap.h.

References ass2data.

bool protlib::ConnectionMap::erase ( AssocData assoc  )  [inline]

Erase the AssocData-element.

Definition at line 98 of file connectionmap.h.

References erase(), and protlib::AssocData::socketfd.

bool protlib::ConnectionMap::erase ( associd_t  associd  ) 

Erase the AssocData-element associated with this socket.

could be deleted

Parameters:
associd association id
Returns:
true if the AssocData-object with associd

Definition at line 128 of file connectionmap.cpp.

References addr2data, ass2data, protlib::AssocData::assoc, lookup(), and protlib::AssocData::peer.

bool protlib::ConnectionMap::erase ( socketfd_t  socketfd  ) 

Erase the AssocData-element associated with this socket.

Returns:
true if the AssocData-object with socketfd could be deleted
Parameters:
socketfd socket file descriptor

Definition at line 112 of file connectionmap.cpp.

References addr2data, ass2data, lookup(), protlib::AssocData::peer, and protlib::AssocData::socketfd.

Referenced by protlib::TPoverTCP::cleanup_receiver_thread(), erase(), and protlib::TPoverTCP::terminate_all_threads().

size_t protlib::ConnectionMap::get_size (  )  const [inline]

get number of records

Definition at line 84 of file connectionmap.h.

References ass2data.

bool protlib::ConnectionMap::insert ( AssocData assoc  ) 

Insert a new AssocData element into the ConnectionMap.

Returns:
true if data is not NULL, if there is not already an entry for data and if it is inserted into the internal hash maps.

Definition at line 56 of file connectionmap.cpp.

References addr2data, ass2data, protlib::AssocData::assoc, protlib::log::ERROR_LOG, Log, protlib::log::LOG_NORMAL, lookup(), protlib::AssocData::peer, and protlib::AssocData::socketfd.

Referenced by protlib::TPoverTCP::get_connection_to(), and protlib::TPoverTCP::master_listener_thread().

AssocData * protlib::ConnectionMap::lookup ( const appladdress addr  )  const

Search for existing connections to this address.

Returns:
a pointer to the AssocData object or NULL.
Parameters:
addr IP-adress + port

Definition at line 101 of file connectionmap.cpp.

References addr2data.

AssocData * protlib::ConnectionMap::lookup ( associd_t  associd  )  const

Search for existing connections to this specific assoc id.

Definition at line 90 of file connectionmap.cpp.

References ass2data.

AssocData * protlib::ConnectionMap::lookup ( socketfd_t  socketfd  )  const

Search for existing connections to this specific socket.

Returns:
a pointer to the AssocData object or NULL.
Parameters:
socketfd socket file descriptor

Definition at line 83 of file connectionmap.cpp.

References ass2data.

Referenced by erase(), protlib::TPoverTCP::get_connection_to(), insert(), protlib::TPoverTCP::send(), and protlib::TPoverTCP::terminate().


Member Data Documentation

map: (application) address to association data

Definition at line 74 of file connectionmap.h.

Referenced by clear(), erase(), insert(), and lookup().

map: socket fd to association data

Definition at line 73 of file connectionmap.h.

Referenced by begin(), clear(), end(), erase(), get_size(), insert(), and lookup().


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

Generated on Fri Aug 14 23:39:49 2009 for Ariba by  doxygen 1.5.8