![]() |
MAK RTIspy API Documentation for HLA Evolved
|
This class is a base for the protocol specific DtRtiAmbassadorImplementor class. More...
Collaboration diagram for DtRtiAmbassadorBaseImplementor:Public Member Functions | |
| virtual | ~DtRtiAmbassadorBaseImplementor () |
| Destructor. | |
| virtual void | addObserver (MAKRti::DtString const &name, DtRtiAmbassadorObserver *observer) |
| Add/Remove observers to the LRC's observer list. | |
| virtual DtRtiAmbassadorObserver * | removeObserver (MAKRti::DtString const &name) |
| virtual void | addFedAmbWrapper (MAKRti::DtString const &name, DtFedAmbWrapper *wrapper) |
| Add/Remove federate wrappers to the LRC's federate wrapper list. | |
| virtual DtFedAmbWrapper * | removeFedAmbWrapper (MAKRti::DtString const &name) |
| virtual bool | enterServiceCall (const MAKRti::DtString &serviceCallName) |
| Prepare for a service call Called by RTI Ambassador services to gain mutually exclusive access to RTI managers. | |
| virtual void | exitServiceCall (const MAKRti::DtString &serviceCallName) |
| Finish a service call. | |
| virtual bool | isConnected () const |
| Is the connection completed? | |
| virtual DtRIDParameters * | params () |
| Get the RID parameters. | |
| virtual DtFederateMgr * | validatedFedMgr () |
| Get the federate mgr Will throw RTI Exception if not initialized. | |
| virtual DtFederateMgr * | nakedFedMgr () |
| Get the federate mgr Returns even when not initialized (with null) | |
| virtual DtConnectionMgr * | validatedConnectMgr () |
| Get the connection mgr Will throw RTI Exception if not initialized. | |
| virtual DtObjectMgr * | objMgr () |
| Get the object mgr If the LRC is unjoined, this will return NULL. | |
| virtual DtInteractionMgr * | interMgr () |
| Get the interaction mgr If the LRC is unjoined, this will return NULL. | |
| virtual DtFomClassMgr * | fomMgr () |
| Get the fom mgr If the LRC is unjoined, this will return NULL. | |
| virtual DtRtiAmbObserverList * | observers () |
| Return the observer list. | |
| virtual const DtRtiAmbObserverList * | observers () const |
| Return the observer list. | |
| virtual void | enableLogging () |
| Enables logging if it is not already enabled Plugin Users should never need to call this. | |
| virtual DtBoost::shared_ptr < MAKRti::DtFilePrinter > | logPrinter () |
| Get the printer which prints output to the log file. | |
| unsigned long | flags () const |
| virtual DtFederateMgr * | validateIsJoined (const MAKRti::DtString &serviceCallName) |
| Validate that federate is joined. | |
| virtual const DtFederateMgr * | validateIsJoined (const MAKRti::DtString &serviceCallName) const |
| Validate that federate is joined. | |
Protected Member Functions | |
| DtRtiAmbassadorBaseImplementor () | |
| Abstract class, do not instantiate. | |
| virtual void | setupConnection (const std::vector< MAKRti::DtString > &rid) |
| Establish preliminary connection configuration and infrastructure. | |
| virtual bool | completeConnection (MAKRti::DtString &errorMessage) |
| Complete the connection infrastructure Throws if there is a fatal failure Returns boolean: connection completed successfully? If not it is possible to try again. | |
| virtual void | clearConnection () |
| Remove the connection. | |
| virtual bool | performMulticastDiscovery () |
| Attempt to automatically detect the RTI Forwarder (or RTI Exec) Returns false if not found. | |
| virtual void | printDisabledService (const MAKRti::DtString &service) |
| Print a disabled service. | |
| virtual unsigned long | incrementServiceCallCount () |
| Increment the service call count and return its value. | |
| virtual bool | tickOnce () |
| Called from tick/evokeCallback: Ticks the federate manager. | |
| virtual void | throwInternalError (const MAKRti::DtString &errorMessage) const =0 |
| Throw an RTI internal exception. | |
| virtual void | throwNotConnected (const MAKRti::DtString &errorMessage) const =0 |
| Throw an RTI not connected exception (internal for 1.3 & 1516) | |
| virtual void | throwNotJoined (const MAKRti::DtString &errorMessage) const =0 |
| Throw an RTI not joined exception. | |
Protected Attributes | |
| DtRIDParameters * | myParams |
| The RTI initialization parameters. | |
| DtConnectionMgr * | myConnectMgr |
| The connection manager. | |
| DtFederateMgr * | myFedMgr |
| The federate manager. | |
| DtRtiPluginManager * | myPluginMgr |
| The plugin manager. | |
| DtRtiAmbObserverList * | myObservers |
| The list of RTI Ambassador observers. | |
| DtBoost::shared_ptr < DtRtiAssistantLrcClient > | myAssistantClient |
| The assistant client. We cache it until we're initialized. | |
| DtBoost::shared_ptr < MAKRti::DtFilePrinter > | myLogPrinter |
| The printer which prints output to the log file. | |
| DtBoost::shared_ptr < DtAssistantPrinter > | myAssistantPrinter |
| The printer which sends output to the assistant file. | |
| bool | myCallbacksEnabled |
| Indicates callbacks enabled status. | |
| MAKRti::DtClock | myClock |
| Clock used for timing. | |
| unsigned long | myFlags |
| bool | myUseBusyWaitForTick |
Private Member Functions | |
| DtRtiAmbassadorBaseImplementor (DtRtiAmbassadorBaseImplementor const &) | |
| Copy Constructor not implemented -- Copy Not Allowed! | |
| DtRtiAmbassadorBaseImplementor & | operator= (DtRtiAmbassadorBaseImplementor const &) |
| Assignment not implemented -- Assignment Not Allowed! | |
This class is a base for the protocol specific DtRtiAmbassadorImplementor class.
It performs the common initialization and processing for setting up connections and establishing the common infrastructure. The protocol specific DtRtiAmbassadorImplementor that derive from this class implement the RTIambassador services defined in the HLA specification by forwarding federate requests to the appropriate sub-managers.
| DtRtiAmbassadorBaseImplementor::DtRtiAmbassadorBaseImplementor | ( | ) | [protected] |
Abstract class, do not instantiate.
Destructor.
References clearConnection().
| DtRtiAmbassadorBaseImplementor::DtRtiAmbassadorBaseImplementor | ( | DtRtiAmbassadorBaseImplementor const & | ) | [private] |
Copy Constructor not implemented -- Copy Not Allowed!
| void DtRtiAmbassadorBaseImplementor::addFedAmbWrapper | ( | MAKRti::DtString const & | name, |
| DtFedAmbWrapper * | wrapper | ||
| ) | [virtual] |
Add/Remove federate wrappers to the LRC's federate wrapper list.
References DtConnectionMgr::addFedAmbWrapper(), and validatedConnectMgr().
| void DtRtiAmbassadorBaseImplementor::addObserver | ( | MAKRti::DtString const & | name, |
| DtRtiAmbassadorObserver * | observer | ||
| ) | [virtual] |
Add/Remove observers to the LRC's observer list.
References DtRtiAmbObserverList::addObserver(), and myObservers.
| void DtRtiAmbassadorBaseImplementor::clearConnection | ( | ) | [protected, virtual] |
Remove the connection.
References isConnected(), myAssistantClient, myAssistantPrinter, myConnectMgr, myFedMgr, myLogPrinter, myObservers, myParams, myPluginMgr, netMsgRsp(), and uninitControl().
Referenced by completeConnection(), setupConnection(), and ~DtRtiAmbassadorBaseImplementor().
| bool DtRtiAmbassadorBaseImplementor::completeConnection | ( | MAKRti::DtString & | errorMessage | ) | [protected, virtual] |
Complete the connection infrastructure Throws if there is a fatal failure Returns boolean: connection completed successfully? If not it is possible to try again.
Error message provided if recoverable failure occurs
References clearConnection(), DtSimpleFederateMgr::create(), DtConnectionMgr::create(), DtFederateMgr::create(), DtRtiExecFederateMgr::create(), DtUseFedObservers, DtRIDParameters::mcastDiscoveryEnabled, myAssistantClient, myConnectMgr, myFedMgr, myParams, myPluginMgr, myUseBusyWaitForTick, performMulticastDiscovery(), DtRIDParameters::printParameters(), DtFederateMgr::setInternalCreatorFunction(), DtRtiPluginManager::start(), throwInternalError(), DtRIDParameters::useBusyWaitForTickMinMax, and DtRIDParameters::useRtiExec.
Referenced by enterServiceCall().
| void DtRtiAmbassadorBaseImplementor::enableLogging | ( | ) | [virtual] |
Enables logging if it is not already enabled Plugin Users should never need to call this.
References myAssistantClient, and myLogPrinter.
Referenced by DtFederateMgr::processAssistantEnableLogging().
| bool DtRtiAmbassadorBaseImplementor::enterServiceCall | ( | const MAKRti::DtString & | serviceCallName | ) | [virtual] |
Prepare for a service call Called by RTI Ambassador services to gain mutually exclusive access to RTI managers.
Also checks that connection is fully initialized (throws if not). Return true if entered with access to lock
References completeConnection(), DtConnectionMgr::enterServiceCall(), isConnected(), throwNotConnected(), and validatedConnectMgr().
| void DtRtiAmbassadorBaseImplementor::exitServiceCall | ( | const MAKRti::DtString & | serviceCallName | ) | [virtual] |
Finish a service call.
References DtConnectionMgr::exitServiceCall(), and validatedConnectMgr().
| unsigned long DtRtiAmbassadorBaseImplementor::flags | ( | ) | const |
References myFlags.
| DtFomClassMgr * DtRtiAmbassadorBaseImplementor::fomMgr | ( | ) | [virtual] |
Get the fom mgr If the LRC is unjoined, this will return NULL.
References DtFederateMgr::fom(), and validatedFedMgr().
| unsigned long DtRtiAmbassadorBaseImplementor::incrementServiceCallCount | ( | ) | [protected, virtual] |
Increment the service call count and return its value.
Null operation if not yet connected (returns 0).
References DtConnectionMgr::incrementServiceCallCount(), and validatedConnectMgr().
| DtInteractionMgr * DtRtiAmbassadorBaseImplementor::interMgr | ( | ) | [virtual] |
Get the interaction mgr If the LRC is unjoined, this will return NULL.
References DtFederateMgr::interMgr(), and validatedFedMgr().
| bool DtRtiAmbassadorBaseImplementor::isConnected | ( | ) | const [virtual] |
Is the connection completed?
References myFedMgr.
Referenced by clearConnection(), and enterServiceCall().
| DtBoost::shared_ptr< MAKRti::DtFilePrinter > DtRtiAmbassadorBaseImplementor::logPrinter | ( | ) | [virtual] |
Get the printer which prints output to the log file.
References myLogPrinter.
| DtFederateMgr * DtRtiAmbassadorBaseImplementor::nakedFedMgr | ( | ) | [virtual] |
Get the federate mgr Returns even when not initialized (with null)
References myFedMgr.
| DtObjectMgr * DtRtiAmbassadorBaseImplementor::objMgr | ( | ) | [virtual] |
Get the object mgr If the LRC is unjoined, this will return NULL.
References DtFederateMgr::objMgr(), and validatedFedMgr().
| DtRtiAmbObserverList * DtRtiAmbassadorBaseImplementor::observers | ( | ) | [virtual] |
Return the observer list.
References myObservers.
| const DtRtiAmbObserverList * DtRtiAmbassadorBaseImplementor::observers | ( | ) | const [virtual] |
Return the observer list.
References myObservers.
| DtRtiAmbassadorBaseImplementor& DtRtiAmbassadorBaseImplementor::operator= | ( | DtRtiAmbassadorBaseImplementor const & | ) | [private] |
Assignment not implemented -- Assignment Not Allowed!
| DtRIDParameters * DtRtiAmbassadorBaseImplementor::params | ( | ) | [virtual] |
| bool DtRtiAmbassadorBaseImplementor::performMulticastDiscovery | ( | ) | [protected, virtual] |
Attempt to automatically detect the RTI Forwarder (or RTI Exec) Returns false if not found.
References DtMulitcastDiscoveryMgr::discover(), DtMulticastDiscoveryMsg::DtDiscoverTcpForwarder, DtRIDParameters::DtFomTransportTypeUseBestEffort, DtMulitcastDiscoveryMgr::init(), DtRIDParameters::mcastDiscoveryEnabled, myParams, DtRIDParameters::setTcpForwarderAddr(), DtRIDParameters::tcpForwarderAddrString(), and DtRIDParameters::useRtiExec.
Referenced by completeConnection().
| void DtRtiAmbassadorBaseImplementor::printDisabledService | ( | const MAKRti::DtString & | service | ) | [protected, virtual] |
Print a disabled service.
References myParams.
| DtFedAmbWrapper * DtRtiAmbassadorBaseImplementor::removeFedAmbWrapper | ( | MAKRti::DtString const & | name | ) | [virtual] |
References DtConnectionMgr::removeFedAmbWrapper(), and validatedConnectMgr().
| DtRtiAmbassadorObserver * DtRtiAmbassadorBaseImplementor::removeObserver | ( | MAKRti::DtString const & | name | ) | [virtual] |
References myObservers, and DtRtiAmbObserverList::removeObserver().
| void DtRtiAmbassadorBaseImplementor::setupConnection | ( | const std::vector< MAKRti::DtString > & | rid | ) | [protected, virtual] |
Establish preliminary connection configuration and infrastructure.
References clearConnection(), DtSmConnectionMgr::create(), DtAsyncConnectionMgr::create(), determineClientAndServerPorts(), DtRIDParameters::DtFomTransportTypeUseFomSettings, DtLrcPlugin, DtRIDParameters::DtSynchronousMode, DtUseFedObservers, initControl(), isControlEnabled(), lm, DtRtiPluginManager::load(), logFileDirectory, logFileName, lrcPluginName(), myAssistantClient, myAssistantPrinter, myFlags, myLogPrinter, myObservers, myParams, myPluginMgr, netFedRsp(), netMsgRsp(), params(), DtRIDParameters::resolveAbsoluteFileLocation(), DtConnectionMgr::setInternalCreatorFunction(), tcpPort, and throwInternalError().
| virtual void DtRtiAmbassadorBaseImplementor::throwInternalError | ( | const MAKRti::DtString & | errorMessage | ) | const [protected, pure virtual] |
Throw an RTI internal exception.
Referenced by completeConnection(), and setupConnection().
| virtual void DtRtiAmbassadorBaseImplementor::throwNotConnected | ( | const MAKRti::DtString & | errorMessage | ) | const [protected, pure virtual] |
Throw an RTI not connected exception (internal for 1.3 & 1516)
Referenced by enterServiceCall(), validatedConnectMgr(), and validatedFedMgr().
| virtual void DtRtiAmbassadorBaseImplementor::throwNotJoined | ( | const MAKRti::DtString & | errorMessage | ) | const [protected, pure virtual] |
Throw an RTI not joined exception.
| bool DtRtiAmbassadorBaseImplementor::tickOnce | ( | ) | [protected, virtual] |
Called from tick/evokeCallback: Ticks the federate manager.
References DtFederateMgr::tick(), and validatedFedMgr().
| DtConnectionMgr * DtRtiAmbassadorBaseImplementor::validatedConnectMgr | ( | ) | [virtual] |
Get the connection mgr Will throw RTI Exception if not initialized.
References myConnectMgr, and throwNotConnected().
Referenced by addFedAmbWrapper(), enterServiceCall(), exitServiceCall(), incrementServiceCallCount(), and removeFedAmbWrapper().
| DtFederateMgr * DtRtiAmbassadorBaseImplementor::validatedFedMgr | ( | ) | [virtual] |
Get the federate mgr Will throw RTI Exception if not initialized.
References myFedMgr, and throwNotConnected().
Referenced by fomMgr(), interMgr(), objMgr(), and tickOnce().
| virtual DtFederateMgr* DtRtiAmbassadorBaseImplementor::validateIsJoined | ( | const MAKRti::DtString & | serviceCallName | ) | [virtual] |
Validate that federate is joined.
If not valid, throw not joined exception. Return the federate manager if everything is OK
| virtual const DtFederateMgr* DtRtiAmbassadorBaseImplementor::validateIsJoined | ( | const MAKRti::DtString & | serviceCallName | ) | const [virtual] |
Validate that federate is joined.
If not valid, throw not joined exception. Return the federate manager if everything is OK
DtBoost::shared_ptr<DtRtiAssistantLrcClient> DtRtiAmbassadorBaseImplementor::myAssistantClient [protected] |
The assistant client. We cache it until we're initialized.
Referenced by clearConnection(), completeConnection(), enableLogging(), and setupConnection().
DtBoost::shared_ptr< DtAssistantPrinter > DtRtiAmbassadorBaseImplementor::myAssistantPrinter [protected] |
The printer which sends output to the assistant file.
Referenced by clearConnection(), and setupConnection().
Indicates callbacks enabled status.
MAKRti::DtClock DtRtiAmbassadorBaseImplementor::myClock [protected] |
Clock used for timing.
The connection manager.
Referenced by clearConnection(), completeConnection(), and validatedConnectMgr().
DtFederateMgr* DtRtiAmbassadorBaseImplementor::myFedMgr [protected] |
The federate manager.
Referenced by clearConnection(), completeConnection(), isConnected(), nakedFedMgr(), and validatedFedMgr().
unsigned long DtRtiAmbassadorBaseImplementor::myFlags [protected] |
Referenced by flags(), and setupConnection().
DtBoost::shared_ptr< MAKRti::DtFilePrinter > DtRtiAmbassadorBaseImplementor::myLogPrinter [protected] |
The printer which prints output to the log file.
Referenced by clearConnection(), enableLogging(), logPrinter(), and setupConnection().
The list of RTI Ambassador observers.
Referenced by addObserver(), clearConnection(), observers(), removeObserver(), and setupConnection().
DtRIDParameters* DtRtiAmbassadorBaseImplementor::myParams [protected] |
The RTI initialization parameters.
Referenced by clearConnection(), completeConnection(), params(), performMulticastDiscovery(), printDisabledService(), and setupConnection().
The plugin manager.
Referenced by clearConnection(), completeConnection(), and setupConnection().
Referenced by completeConnection().