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

#include <ORB.H>

Inheritance diagram for ORB::ORBReplicator:
[legend]
Collaboration diagram for ORB::ORBReplicator:
[legend]

Public Member Functions

 ORBReplicator (int argc, char *argv[], string transportNameIn, string ipAddress)
 
 ORBReplicator (int argc, char *argv[], string transportNameIn, string ipAddress, int basePortDifferent)
 
 ORBReplicator (int argc, char *argv[], string transportNameIn, string ipAddress, const vector< pair< string, string > > extraProperties)
 
 ORBReplicator (int argc, char *argv[], string transportNameIn, string ipAddress, const vector< pair< string, string > > extraProperties, int basePortDifferent)
 
virtual Ice::ObjectPtr create (const std::string &)=0
 
void addClass (Ice::ObjectPtr objectToORB, const string &name)
 
void shutdown (void)
 
template<typename PRXTYPE >
PRXTYPE getObjectProxy (const string &nameIn)
 
template<typename CLASSTYPE >
CLASSTYPE * getObjectPointer (const string &nameIn)
 
bool connectedOK ()
 
- Public Member Functions inherited from ORB::ORBOriginator
 ORBOriginator (int argc, char *argv[], string transportNameIn)
 
 ORBOriginator (int argc, char *argv[], string transportNameIn, int basePortDifferent)
 
 ORBOriginator (int argc, char *argv[], string transportNameIn, const vector< pair< string, string > > extraProperties)
 
 ORBOriginator (int argc, char *argv[], string transportNameIn, const vector< pair< string, string > > extraProperties, int basePortDifferent)
 
virtual ~ORBOriginator (void)
 Destructor. More...
 
void shutdown (const Ice::Current &cur)
 
bool isShutdown ()
 
void addClass (Ice::ObjectPtr objectToORB, const string &name)
 
void waitForShutdown (void)
 
- Public Member Functions inherited from ORB::ORBBase
 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 destroy ()
 
void initialise (void)
 

Private Attributes

ORB::ORBICEPrx oRBOriginatorPrx
 The proxy of the ORBOriginator on the other side of the network. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ORB::ORBOriginator
 ORBOriginator (int argc, char *argv[], string transportNameIn, string ipAddress)
 
 ORBOriginator (int argc, char *argv[], string transportNameIn, string ipAddress, const vector< pair< string, string > > extraProperties)
 
 ORBOriginator (int argc, char *argv[], string transportNameIn, string ipAddress, int basePortDifferent)
 
 ORBOriginator (int argc, char *argv[], string transportNameIn, string ipAddress, const vector< pair< string, string > > extraProperties, int basePortDifferent)
 
void initialise (int argc, char *argv[], string transportNameIn, string ipAddress, const vector< pair< string, string > > extraProperties)
 
void initialiseAdapter (void)
 
void getObjectPointer (const string &name, Ice::ObjectPtr &objectPointer, const Ice::Current &cur)
 
- Protected Attributes inherited from ORB::ORBOriginator
int portOffset
 The port offset of this application layer. More...
 
string hostAddress
 The hostname or IP address of the node to connect to, empty for the originator and set for the replicator. More...
 
string transportName
 Zeroc ICE application layer name. More...
 
Ice::CommunicatorPtr communicator
 Resident communicator. More...
 
Ice::ObjectAdapterPtr adapterPtr
 Resident adapter. More...
 

Detailed Description

Sets up a replicator which connects to an originator.

The local proxy objects will operate the originator's object's methods, get the proxy using the ORBReplicator::getObjectProxy method.

The local pointer objects will access the originator's object's variables, get the pointer using the ORBReplicator::getObjectPointer method.

Each ORBReplicator class must implement the purely virtual method ORBReplicator::create to instruct the class factory which classes to generate and how.

Examples:
ORBTest.C.

Definition at line 431 of file ORB.H.

Constructor & Destructor Documentation

◆ ORBReplicator() [1/4]

ORB::ORBReplicator::ORBReplicator ( int  argc,
char *  argv[],
string  transportNameIn,
string  ipAddress 
)
inline

Generates a new ZeroC ICE application layer replicator. The endpoints of the application layer are derived by ORBBase. The ice configuration transportName.Control and transportName.Endpoints are auto-generated

Parameters
argcThe command line argument count
argvThe command line arguments
transportNameInThe name of this application layer, which enables ICE to lookup using the appropriate endpoints
ipAddressthe host to connect to whos endpoints should be open and ready for connecting

Definition at line 463 of file ORB.H.

◆ ORBReplicator() [2/4]

ORB::ORBReplicator::ORBReplicator ( int  argc,
char *  argv[],
string  transportNameIn,
string  ipAddress,
int  basePortDifferent 
)
inline

Generates a new ZeroC ICE application layer replicator. The endpoints of the application layer are derived by ORBBase. The ice configuration transportName.Control and transportName.Endpoints are auto-generated

Parameters
argcThe command line argument count
argvThe command line arguments
transportNameInThe name of this application layer, which enables ICE to lookup using the appropriate endpoints
ipAddressthe host to connect to whos endpoints should be open and ready for connecting
basePortDifferentSpecify a different base port to the default normally used by ORBBase

Definition at line 476 of file ORB.H.

◆ ORBReplicator() [3/4]

ORB::ORBReplicator::ORBReplicator ( int  argc,
char *  argv[],
string  transportNameIn,
string  ipAddress,
const vector< pair< string, string > >  extraProperties 
)
inline

Generates a new ZeroC ICE application layer replicator. The endpoints of the application layer are derived by ORBBase. The ice configuration transportName.Control and transportName.Endpoints are auto-generated.

Parameters
argcThe command line argument count
argvThe command line arguments
transportNameInThe name of this application layer, which enables ICE to lookup using the appropriate endpoints
ipAddressthe host to connect to whos endpoints should be open and ready for connecting
extraPropertiesExtra communicator properties to initialise the communicator with

Definition at line 489 of file ORB.H.

◆ ORBReplicator() [4/4]

ORB::ORBReplicator::ORBReplicator ( int  argc,
char *  argv[],
string  transportNameIn,
string  ipAddress,
const vector< pair< string, string > >  extraProperties,
int  basePortDifferent 
)
inline

Generates a new ZeroC ICE application layer replicator. The endpoints of the application layer are derived by ORBBase. The ice configuration transportName.Control and transportName.Endpoints are auto-generated.

Parameters
argcThe command line argument count
argvThe command line arguments
transportNameInThe name of this application layer, which enables ICE to lookup using the appropriate endpoints
ipAddressthe host to connect to whos endpoints should be open and ready for connecting
extraPropertiesExtra communicator properties to initialise the communicator with
basePortDifferentSpecify a different base port to the default normally used by ORBBase

Definition at line 503 of file ORB.H.

Here is the call graph for this function:

Member Function Documentation

◆ addClass()

void ORB::ORBReplicator::addClass ( Ice::ObjectPtr  objectToORB,
const string &  name 
)
inline

Overload this method so that it doesn't get called by mistake in a replicator.

Parameters
objectToORBThe calss which will be added to the ORB application layer
nameThe name to give to the network. This name must be unique

Definition at line 526 of file ORB.H.

◆ connectedOK()

bool ORB::ORBReplicator::connectedOK ( )
inline

Find out whether we connected to the other side ok.

Returns
true if connected, false if not.

Definition at line 573 of file ORB.H.

◆ create()

virtual Ice::ObjectPtr ORB::ORBReplicator::create ( const std::string &  )
pure virtual

Each of your overloaded classes must implement the ORBOriginator::create method. This is the method which is called to create your desired class when required.

◆ destroy()

void ORB::ORBReplicator::destroy ( )
inlineprivate

Method required by Ice::ObjectFactory

Definition at line 436 of file ORB.H.

◆ getObjectPointer()

template<typename CLASSTYPE >
CLASSTYPE* ORB::ORBReplicator::getObjectPointer ( const string &  nameIn)
inline

Get a calss from the ORB layer (this will give you access to the variables as they are on the originator however the methods run on the replicator). It is like creating the class locally but setting its state to be identical to that of the same clas on the originator at the point in time the method is executed. The proxy must be set using the ORBOriginator::addClass method first. This method returns a pointer to CLASSTYPE which is not memory managed. Ensure you call CLASSTYPE *c; c->__setNoDelete(false); to re-enable memory management

Parameters
nameInThe name of the class we are looking for on the ORB network
Returns
desired pointer or NULL on failure
Template Parameters
CLASSTYPEThe class which we want to get from the ORB network - must match the nameIn used in the ORBOriginator::addClass AND the iceIdIn

Definition at line 558 of file ORB.H.

◆ getObjectProxy()

template<typename PRXTYPE >
PRXTYPE ORB::ORBReplicator::getObjectProxy ( const string &  nameIn)
inline

Get a proxy from the ORB layer (this will give you access to the methods on the originator). The proxy must be set using the ORBOriginator::addClass method first.

Parameters
nameInThe name of the class we are looking for on the ORB network
Returns
desired proxy or NULL on failure
Template Parameters
PRXTYPEThe class which we want to get from the ORB network

Definition at line 543 of file ORB.H.

◆ initialise()

void ORB::ORBReplicator::initialise ( void  )
inlineprivate

Gets the ORBOriginator proxy and sets the oRBOriginatorPrx variable. Upon failure, an assertion is generated (this may need to be replaced in future).

Definition at line 442 of file ORB.H.

◆ shutdown()

void ORB::ORBReplicator::shutdown ( void  )
inline

Tell the SerlialiseOriginator to shutdown.

Definition at line 532 of file ORB.H.

Member Data Documentation

◆ oRBOriginatorPrx

ORB::ORBICEPrx ORB::ORBReplicator::oRBOriginatorPrx
private

The proxy of the ORBOriginator on the other side of the network.

Definition at line 432 of file ORB.H.


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