GTK+ IOStream  Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ORB::ORBBase Class Reference

#include <ORB.H>

Inheritance diagram for ORB::ORBBase:
Inheritance graph
[legend]
Collaboration diagram for ORB::ORBBase:
Collaboration graph
[legend]

Public Member Functions

 ORBBase (void)
 Constructor using ORB_DEFAULT_BASEPORT as the starting base network port. More...
 
 ORBBase (int basePortDifferent)
 
int getPortOffset (void)
 
void removePortOffset (int whichOffset)
 
int getTCPUDPPort (int portOffset)
 
int getSSLPort (int portOffset)
 
int getBasePort (void)
 
string generateEndPoint (const string &transportName, std::string &ipAddress, int &portOffset)
 
string generateEndPoint (string &transportName, string ipAddress, int portOffset)
 

Private Member Functions

void init (int basePortDifferent)
 

Private Attributes

int basePort
 The starting network port. More...
 
IceUtil::Mutex countMutex
 Mutex semaphore to enable the manipulation of the offsetList. More...
 
list< intoffsetList
 The list of port offsets used. More...
 

Detailed Description

Common class to maintain port offsets

The offsetList is a list of integers which represents available port offsets from a network basePort. Each time ORBBase::getPortOffset() is called, the first available port offset is added to the list of used offsets (offsetList) and returned. This class also provides methods for generating the actual TCP, UDP and SSL socket ports from the provided details and the class state. This class also provides a method for generating sensible Zeroc ICE endpoint (and proxy) strings using the ORBBase::generateEndPoint method. The ORBBase::generateEndPoint method is used for both the ORBOriginator and ORBReplicator sides of the network.

Definition at line 86 of file ORB.H.

Constructor & Destructor Documentation

ORB::ORBBase::ORBBase ( void  )
inline

Constructor using ORB_DEFAULT_BASEPORT as the starting base network port.

Definition at line 98 of file ORB.H.

ORB::ORBBase::ORBBase ( int  basePortDifferent)
inline

Definition at line 101 of file ORB.H.

Member Function Documentation

string ORB::ORBBase::generateEndPoint ( const string &  transportName,
std::string &  ipAddress,
int portOffset 
)
inline
Generates an endpoint string specifying where others will connect to OR what to connect to.
Parameters
transportNameis the name of the application layer property which will provide ORB services
ipAddressif not empty, then append the host's ip address (or hostname) to connect to, otherwise, if empty, generate the endpoint string to route to a machine on a network
portOffsetThe offset from the basePort to use
Returns
a suitable end point string

Definition at line 164 of file ORB.H.

string ORB::ORBBase::generateEndPoint ( string &  transportName,
string  ipAddress,
int  portOffset 
)
inline
generates an endpoint string specifying where others will connect to OR what to connect to.
Parameters
transportNameis the name of the application layer property which will provide ORB services
ipAddressif not empty, then append the host's ip address (or hostname) to connect to, otherwise, if empty, generate the endpoint string to route to a machine on a network
portOffsetThe offset from the basePort to use
Returns
a suitable end point string

Definition at line 176 of file ORB.H.

int ORB::ORBBase::getBasePort ( void  )
inline
Get the base port.

This base port is the port to connect to on the originator of the network layer

Returns
basePort The base port of the system

Definition at line 154 of file ORB.H.

int ORB::ORBBase::getPortOffset ( void  )
inline
Get a new port offset to use
Returns
an un-used port offset

Definition at line 107 of file ORB.H.

int ORB::ORBBase::getSSLPort ( int  portOffset)
inline
Get the SSL port for connection

NOTE: currently SSL is not activated in generateEndPoint because it requires a valid cert.

Parameters
portOffsetThe portOffset to use
Returns
The SSL port matching the supplied portOffset

Definition at line 146 of file ORB.H.

int ORB::ORBBase::getTCPUDPPort ( int  portOffset)
inline
Get the TCP and UDP ports for connection
Parameters
portOffsetThe portOffset to use
Returns
The UDP and TCP port matching the supplied portOffset

Definition at line 137 of file ORB.H.

void ORB::ORBBase::init ( int  basePortDifferent)
inlineprivate
initialise the class
Parameters
basePortDifferentthe intended basePort value

Definition at line 93 of file ORB.H.

void ORB::ORBBase::removePortOffset ( int  whichOffset)
inline
Remove a port offset from the offsetList, which will free it up for future use
Parameters
whichOffsetis the port offset to remove from the list if present

Definition at line 127 of file ORB.H.

Member Data Documentation

int ORB::ORBBase::basePort
private

The starting network port.

Definition at line 87 of file ORB.H.

IceUtil::Mutex ORB::ORBBase::countMutex
private

Mutex semaphore to enable the manipulation of the offsetList.

Definition at line 88 of file ORB.H.

list<int> ORB::ORBBase::offsetList
private

The list of port offsets used.

Definition at line 89 of file ORB.H.


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