gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
ORB::ORBBase Class Reference

#include <ORB.H>

Inheritance diagram for ORB::ORBBase:
[legend]
Collaboration diagram for ORB::ORBBase:
[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< int > offsetList
 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 101 of file ORB.H.

Constructor & Destructor Documentation

◆ ORBBase() [1/2]

ORB::ORBBase::ORBBase ( void  )
inline

Constructor using ORB_DEFAULT_BASEPORT as the starting base network port.

Definition at line 113 of file ORB.H.

◆ ORBBase() [2/2]

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

Definition at line 116 of file ORB.H.

Member Function Documentation

◆ generateEndPoint() [1/2]

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 179 of file ORB.H.

◆ generateEndPoint() [2/2]

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 191 of file ORB.H.

◆ getBasePort()

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 169 of file ORB.H.

◆ getPortOffset()

int ORB::ORBBase::getPortOffset ( void  )
inline

Get a new port offset to use

Returns
an un-used port offset

Definition at line 122 of file ORB.H.

◆ getSSLPort()

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 161 of file ORB.H.

◆ getTCPUDPPort()

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 152 of file ORB.H.

◆ init()

void ORB::ORBBase::init ( int  basePortDifferent)
inlineprivate

initialise the class

Parameters
basePortDifferentthe intended basePort value

Definition at line 108 of file ORB.H.

◆ removePortOffset()

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 142 of file ORB.H.

Member Data Documentation

◆ basePort

int ORB::ORBBase::basePort
private

The starting network port.

Definition at line 102 of file ORB.H.

◆ countMutex

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

Mutex semaphore to enable the manipulation of the offsetList.

Definition at line 103 of file ORB.H.

◆ offsetList

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

The list of port offsets used.

Definition at line 104 of file ORB.H.


The documentation for this class was generated from the following file:
gtkIOStream: ORB::ORBBase Class Reference
GTK+ IOStream  Beta