![]() |
MAK RTIspy API Documentation for HLA 1.3
|
The DtWwwSpyAdapter class provides the interface between any RTI component and the WebSpy server. More...
Inheritance diagram for DtWwwSpyAdapter:
Collaboration diagram for DtWwwSpyAdapter:Public Types | |
| typedef DtWwwSpyAdapter *(* | CreatorType )(const DtRIDParameters ¶ms, 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 DtRtiMsg * | getNextMsg ()=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 DtWwwSpyAdapter * | create (const DtRIDParameters ¶ms, 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 ¶ms, 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 DtRIDParameters & | myParams |
| 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. | |
| DtWwwSpyAdapter & | operator= (DtWwwSpyAdapter &) |
| Copy and Assignment unimplmented. | |
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.)
| typedef DtWwwSpyAdapter*(* DtWwwSpyAdapter::CreatorType)(const DtRIDParameters ¶ms, DtWebSpyUtils::ConnectionType type, unsigned long connId) |
Web Spy Adapter creator method.
| DtWwwSpyAdapter::DtWwwSpyAdapter | ( | const DtWwwSpyAdapter & | ) | [private] |
Copy and Assignment unimplemented.
| DtWwwSpyAdapter::~DtWwwSpyAdapter | ( | ) | [virtual] |
Dtor.
| DtWwwSpyAdapter::DtWwwSpyAdapter | ( | const DtRIDParameters & | params, |
| DtWebSpyUtils::ConnectionType | type, | ||
| unsigned long | connId | ||
| ) | [protected] |
Ctor protected - use virtual ctor method.
| bool DtWwwSpyAdapter::connectionStatusOk | ( | ) | const [virtual] |
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 constructor.
Reimplemented in DtTcpWwwSpyAdapter.
References initialize(), and theCreator.
Referenced by DtForwarderWebManager::DtForwarderWebManager(), and DtRtiExecWebManager::DtRtiExecWebManager().
| 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.
| void DtWwwSpyAdapter::setCreatorFunction | ( | CreatorType | creator | ) | [static] |
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().
DtClock DtWwwSpyAdapter::myClock [protected] |
Referenced by DtTcpWwwSpyAdapter::getConnectMsg().
bool DtWwwSpyAdapter::myConnectionStatus [protected] |
Referenced by connectionStatusOk(), DtTcpWwwSpyAdapter::getNextMsg(), initialize(), and DtTcpWwwSpyAdapter::postMsg().
unsigned long DtWwwSpyAdapter::myConnId [protected] |
Referenced by DtTcpWwwSpyAdapter::sendTypeInfo().
bool DtWwwSpyAdapter::myForwardingEnabled [protected] |
const DtRIDParameters& DtWwwSpyAdapter::myParams [protected] |
DtWebSpyUtils::ConnectionType DtWwwSpyAdapter::myType [protected] |
Referenced by DtTcpWwwSpyAdapter::sendTypeInfo().
DtWwwSpyAdapter::CreatorType DtWwwSpyAdapter::theCreator = 0 [static, protected] |
Referenced by create(), and setCreatorFunction().
unsigned int DtWwwSpyAdapter::theMaxConnectionAttempts = 10 [static, protected] |
Referenced by initialize().