MAK RTIspy API Documentation for HLA Evolved
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtWwwSpyAdapter Class Reference

The DtWwwSpyAdapter class provides the interface between any RTI component and the WebSpy server. More...

+ Inheritance diagram for DtWwwSpyAdapter:
+ Collaboration diagram for DtWwwSpyAdapter:

List of all members.

Public Types

typedef DtWwwSpyAdapter *(* CreatorType )(const DtRIDParameters &params, DtWebSpyUtils::ConnectionType type, unsigned long connId)
 Web Spy Adapter creator method.

Public Member Functions

virtual ~DtWwwSpyAdapter ()
 Dtor.
virtual bool connectionStatusOk () const
 Is the adapter connected and viable? False until initial connection, and Set to false if HTTP server goes down.
virtual DtRtiMsggetNextMsg ()=0
 Read a message from the web server (returns null if none pending)
virtual void postMsg (const DtRtiMsg &msg)=0
 Post a response to the web server.

Static Public Member Functions

static DtWwwSpyAdaptercreate (const DtRIDParameters &params, DtWebSpyUtils::ConnectionType type, unsigned long connId)
 Virtual constructor.
static void setCreatorFunction (CreatorType creator)
 Set the concrete type for the virtual constructor method.
static bool startWebServerProcess (const DtFilename &processName, const DtFilename &workingDir, std::vector< const char * > &args)
 Attempt to start the WWW Server process Return boolean: process started (not necessarily complete but at least the executable was there)

Protected Member Functions

 DtWwwSpyAdapter (const DtRIDParameters &params, DtWebSpyUtils::ConnectionType type, unsigned long connId)
 Ctor protected - use virtual ctor method.
virtual void initialize ()
 Post-construction initialization called by virtual ctor (by default, it creates a server and connects)
virtual bool connectToWebServer ()=0
 Attempt to open a connection and handshake with the server Returns false if connection fails NOTE: by default failure indicates that server needs to be started.
virtual bool startWebServer ()=0
 Attempt to start a new web server Return boolean: process started (not necessarily complete but at least the executable was there)

Protected Attributes

const DtRIDParametersmyParams
DtWebSpyUtils::ConnectionType myType
bool myForwardingEnabled
DtClock myClock
unsigned long myConnId
bool myConnectionStatus

Static Protected Attributes

static unsigned int theMaxConnectionAttempts = 10
static CreatorType theCreator = 0

Private Member Functions

 DtWwwSpyAdapter (const DtWwwSpyAdapter &)
 Copy and Assignment unimplemented.
DtWwwSpyAdapteroperator= (DtWwwSpyAdapter &)
 Copy and Assignment unimplmented.

Detailed Description

The DtWwwSpyAdapter class provides the interface between any RTI component and the WebSpy server.

It is responsible for creating, connecting to, and communicating with the web server.

The DtWwwSpyAdapter is an abstract base class. This allows the derived class to select the method of connection to the Web Server ( tcp, shared mem, etc.)


Member Typedef Documentation

typedef DtWwwSpyAdapter*(* DtWwwSpyAdapter::CreatorType)(const DtRIDParameters &params, DtWebSpyUtils::ConnectionType type, unsigned long connId)

Web Spy Adapter creator method.


Constructor & Destructor Documentation

Copy and Assignment unimplemented.

Dtor.

DtWwwSpyAdapter::DtWwwSpyAdapter ( const DtRIDParameters params,
DtWebSpyUtils::ConnectionType  type,
unsigned long  connId 
) [protected]

Ctor protected - use virtual ctor method.


Member Function Documentation

Is the adapter connected and viable? False until initial connection, and Set to false if HTTP server goes down.

References myConnectionStatus.

virtual bool DtWwwSpyAdapter::connectToWebServer ( ) [protected, pure virtual]

Attempt to open a connection and handshake with the server Returns false if connection fails NOTE: by default failure indicates that server needs to be started.

Implemented in DtTcpWwwSpyAdapter.

Referenced by initialize().

DtWwwSpyAdapter * DtWwwSpyAdapter::create ( const DtRIDParameters params,
DtWebSpyUtils::ConnectionType  type,
unsigned long  connId 
) [static]
virtual DtRtiMsg* DtWwwSpyAdapter::getNextMsg ( ) [pure virtual]

Read a message from the web server (returns null if none pending)

Implemented in DtTcpWwwSpyAdapter.

void DtWwwSpyAdapter::initialize ( ) [protected, virtual]

Post-construction initialization called by virtual ctor (by default, it creates a server and connects)

References connectToWebServer(), myConnectionStatus, myParams, startWebServer(), theMaxConnectionAttempts, and DtRIDParameters::webserviceAddrString.

Referenced by create().

DtWwwSpyAdapter& DtWwwSpyAdapter::operator= ( DtWwwSpyAdapter ) [private]

Copy and Assignment unimplmented.

virtual void DtWwwSpyAdapter::postMsg ( const DtRtiMsg msg) [pure virtual]

Post a response to the web server.

Implemented in DtTcpWwwSpyAdapter.

Set the concrete type for the virtual constructor method.

References theCreator.

Referenced by DtForwarderWebManager::DtForwarderWebManager(), and DtRtiExecWebManager::DtRtiExecWebManager().

virtual bool DtWwwSpyAdapter::startWebServer ( ) [protected, pure virtual]

Attempt to start a new web server Return boolean: process started (not necessarily complete but at least the executable was there)

Implemented in DtTcpWwwSpyAdapter.

Referenced by initialize().

bool DtWwwSpyAdapter::startWebServerProcess ( const DtFilename &  processName,
const DtFilename &  workingDir,
std::vector< const char * > &  args 
) [static]

Attempt to start the WWW Server process Return boolean: process started (not necessarily complete but at least the executable was there)

References DtCreateProcess__rti__(), and DtProcNonInteractive__rti__.

Referenced by DtTcpWwwSpyAdapter::startWebServer().


Member Data Documentation

DtClock DtWwwSpyAdapter::myClock [protected]
unsigned long DtWwwSpyAdapter::myConnId [protected]

Referenced by create(), and setCreatorFunction().

unsigned int DtWwwSpyAdapter::theMaxConnectionAttempts = 10 [static, protected]

Referenced by initialize().


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

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)