![]() |
MAK RTIspy API Documentation for HLA Evolved
|
This class represents a network connection with another RTI component. More...
Inheritance diagram for DtRtiConnection:
Collaboration diagram for DtRtiConnection:Public Member Functions | |
| DtRtiConnection (DtMsgSocket *skt) | |
| Constructor. | |
| virtual | ~DtRtiConnection () |
| Destructor. | |
| virtual void | setMsgFactory (DtRtiMsgFactory *fact) |
| Set/Get the Message Factory used by this object. | |
| virtual DtRtiMsgFactory * | rtiMsgFactory () |
| virtual DtRtiMsg * | netRead (DtNetReadStatus *retCode=NULL) |
| Note: netRead() creates a new DtRtiMsg using the message factory Caller is responsible for deleting it when through. | |
| virtual int | send (const DtRtiMsg &msg, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr()) |
| Send a message. | |
| virtual bool | flush () |
| Send buffered messages. | |
| virtual int | isOk () |
| Return true if the status of the connection is OK. | |
| virtual void | setCheckVersion (bool enableCheckVersion) |
| Set/get whether to check message version. | |
| virtual bool | checkVersion () const |
| virtual void | disableCheckSize () |
| Disable message size check. | |
| virtual void | enableCheckSize () |
| Enable message size check. | |
| virtual void | setFedExName (const MAKRti::DtString &newFedExName) |
| Set/Get federation execution name. NULL means "all". | |
| virtual const MAKRti::DtString & | fedExName () const |
| virtual void | setFedExHandle (int handle) |
| Set/Get federation execution handle. 0 means "all". | |
| virtual int | fedExHandle () const |
| virtual void | setFederateHandle (DtFederationHandle handle) |
| Set/Get federate handle. | |
| virtual DtFederationHandle | federateHandle () const |
| virtual void | setConnId (unsigned long connId) |
| Set/Get the connection ID assigned to the connection. | |
| virtual unsigned long | connId () const |
| virtual DtMsgSocket * | socket () |
| Returns our socket. | |
Protected Member Functions | |
| void | init (DtMsgSocket *s) |
Protected Attributes | |
| MAKRti::DtString | myFedExName |
| int | myFedExHandle |
| DtFederationHandle | myFedHandle |
| DtMsgSocket * | mySocket |
| DtRtiMsgFactory * | myMsgFact |
| unsigned long | myReceivedMsgCount |
| bool | myCheckSize |
| bool | myCheckVersion |
| unsigned int | myWaitEventIndex |
| unsigned long | myConnId |
| Win32 only. | |
Private Member Functions | |
| DtRtiConnection (const DtRtiConnection &orig) | |
| Copy CTOR not implemented. | |
| DtRtiConnection & | operator= (DtRtiConnection const &orig) |
| Assignment Operator not implemented. | |
This class represents a network connection with another RTI component.
Constructor.
References DtBindMessage(), and init().
| DtRtiConnection::~DtRtiConnection | ( | ) | [virtual] |
Destructor.
| DtRtiConnection::DtRtiConnection | ( | const DtRtiConnection & | orig | ) | [private] |
Copy CTOR not implemented.
| bool DtRtiConnection::checkVersion | ( | ) | const [virtual] |
References myCheckVersion.
Referenced by netRead().
| unsigned long DtRtiConnection::connId | ( | ) | const [inline, virtual] |
References myConnId.
Referenced by DtConnectionMgr::processConnections(), and setConnId().
| void DtRtiConnection::disableCheckSize | ( | ) | [virtual] |
Disable message size check.
References myCheckSize.
| void DtRtiConnection::enableCheckSize | ( | ) | [virtual] |
Enable message size check.
References myCheckSize.
| DtFederationHandle DtRtiConnection::federateHandle | ( | ) | const [inline, virtual] |
References myFedHandle.
| int DtRtiConnection::fedExHandle | ( | ) | const [inline, virtual] |
References myFedExHandle.
| const MAKRti::DtString & DtRtiConnection::fedExName | ( | ) | const [inline, virtual] |
References myFedExName.
| bool DtRtiConnection::flush | ( | ) | [virtual] |
Send buffered messages.
Returns indication of whether the flush is complete or incomplete.
Reimplemented in DtSmRtiConnection.
References DtMsgSocket::flush(), isOk(), DtMsgSocket::lastError(), PERROR, and socket().
Referenced by DtConnectionMgr::flush(), DtConnectionMgr::repairFederationConnection(), and DtAsyncConnectionMgr::sendPackets().
| void DtRtiConnection::init | ( | DtMsgSocket * | s | ) | [protected] |
References myFedExHandle, myFedExName, myFedHandle, myMsgFact, mySocket, NULL, and DtMsgSocket::state().
Referenced by DtRtiConnection().
| int DtRtiConnection::isOk | ( | ) | [virtual] |
Return true if the status of the connection is OK.
References mySocket, and DtMsgSocket::state().
Referenced by DtConnectionMgr::destroyRelConn(), flush(), netRead(), DtConnectionMgr::processConnections(), DtAsyncConnectionMgr::receivePackets(), send(), and DtAsyncConnectionMgr::sendPackets().
| DtRtiMsg * DtRtiConnection::netRead | ( | DtNetReadStatus * | retCode = NULL | ) | [virtual] |
Note: netRead() creates a new DtRtiMsg using the message factory Caller is responsible for deleting it when through.
References checkVersion(), DtMessageFactory< T_Message, T_MessageKind, T_NetworkHeader >::create(), DtInvalidMsgKind, DtNET_BUFFER_TOO_SMALL, DtNET_READ_BAD_PACKET, DtNET_READ_FILTERED_PACKET, DtNET_READ_NO_PACKETS, DtNET_READ_SIZE_MISMATCH, DtNET_READ_SUCCESS, DtNET_READ_VERSION_MISMATCH, DtNET_READ_VERSION_UNKNOWN, DtNET_UNKNOWN_ERROR, DtRtiMessageVersion, DtRtiMessageVersionString(), isOk(), DtRtiMsg::kindToString(), DtMsgSocket::lastError(), MSG_STATUS_OK, myCheckSize, myFedExHandle, myFedExName, NULL, PERROR, DtMsgSocket::recvMessage(), rtiMsgFactory(), socket(), and DtRtiMsg::status().
Referenced by DtConnectionMgr::createAncillaryRelConns(), DtConnectionMgr::createRelConn(), DtConnectionMgr::destroyRelConn(), DtSmConnectionMgr::getMessage(), DtConnectionMgr::getMessage(), DtSmConnectionMgr::processConnection(), DtRtiShmQNetMgr::processConnection(), DtConnectionMgr::processConnection(), DtAsyncConnectionMgr::receivePacket(), and DtConnectionMgr::repairFederationConnection().
| DtRtiConnection& DtRtiConnection::operator= | ( | DtRtiConnection const & | orig | ) | [private] |
Assignment Operator not implemented.
| DtRtiMsgFactory * DtRtiConnection::rtiMsgFactory | ( | ) | [inline, virtual] |
| int DtRtiConnection::send | ( | const DtRtiMsg & | msg, |
| const MAKRti::DtInetAddr & | addr = MAKRti::DtInetAddr() |
||
| ) | [virtual] |
Send a message.
Reimplemented in DtGsRtiConnection, and DtSmRtiConnection.
References DtUseFedObservers, DtNetMsgHeader::flags, isOk(), DtMsgSocket::lastError(), DtRtiMsg::netHeader(), PERROR, DtMsgSocket::sendMessage(), and socket().
Referenced by DtConnectionMgr::createAncillaryRelConns(), DtConnectionMgr::destroyRelConn(), DtConnectionMgr::send(), and DtAsyncConnectionMgr::sendPackets().
| void DtRtiConnection::setCheckVersion | ( | bool | enableCheckVersion | ) | [virtual] |
Set/get whether to check message version.
This connection will filter invalid versions when enabled.
References myCheckVersion.
| void DtRtiConnection::setConnId | ( | unsigned long | connId | ) | [inline, virtual] |
Set/Get the connection ID assigned to the connection.
References connId(), and myConnId.
Referenced by DtConnectionMgr::createAncillaryRelConns(), and DtConnectionMgr::createRelConn().
| void DtRtiConnection::setFederateHandle | ( | DtFederationHandle | handle | ) | [inline, virtual] |
Set/Get federate handle.
References myFedHandle.
Referenced by DtSmConnectionMgr::connectFederation(), DtConnectionMgr::connectFederation(), DtSmConnectionMgr::disconnectFederation(), DtConnectionMgr::disconnectFederation(), DtSmConnectionMgr::repairFederationConnection(), DtConnectionMgr::repairFederationConnection(), and DtConnectionMgr::setFederateHandle().
| void DtRtiConnection::setFedExHandle | ( | int | handle | ) | [inline, virtual] |
Set/Get federation execution handle. 0 means "all".
References myFedExHandle.
Referenced by DtSmConnectionMgr::connectFederation(), DtConnectionMgr::connectFederation(), DtSmConnectionMgr::disconnectFederation(), DtConnectionMgr::disconnectFederation(), DtSmConnectionMgr::repairFederationConnection(), and DtConnectionMgr::repairFederationConnection().
| void DtRtiConnection::setFedExName | ( | const MAKRti::DtString & | newFedExName | ) | [inline, virtual] |
Set/Get federation execution name. NULL means "all".
References myFedExName.
Referenced by DtSmConnectionMgr::connectFederation(), DtConnectionMgr::connectFederation(), DtSmConnectionMgr::disconnectFederation(), DtConnectionMgr::disconnectFederation(), DtSmConnectionMgr::repairFederationConnection(), and DtConnectionMgr::repairFederationConnection().
| void DtRtiConnection::setMsgFactory | ( | DtRtiMsgFactory * | fact | ) | [virtual] |
Set/Get the Message Factory used by this object.
fact becomes property of this object, meaning it will be deleted when the factory is replaced, or when the DtRtiConnection is destroyed.
References myMsgFact.
Referenced by DtConnectionMgr::createAncillaryRelConns(), DtConnectionMgr::createBestEffortConn(), DtConnectionMgr::createRelConn(), DtSmConnectionMgr::createSharedMemConn(), DtSmConnectionMgr::setMsgFactory(), and DtConnectionMgr::setMsgFactory().
| DtMsgSocket * DtRtiConnection::socket | ( | ) | [inline, virtual] |
Returns our socket.
References mySocket.
Referenced by DtConnectionMgr::createAncillaryRelConns(), DtConnectionMgr::destroyAncillaryRelConn(), DtConnectionMgr::destroyAncillaryRelConns(), DtConnectionMgr::destroyBestEffortConn(), DtConnectionMgr::destroyRelConn(), DtConnectionMgr::disconnectFederation(), DtConnectionMgr::dropMulticastGroup(), flush(), DtConnectionMgr::flush(), DtConnectionMgr::forceDropMulticastGroup(), DtRtiShmQNetMgr::init(), DtSmConnectionMgr::initConnections(), DtConnectionMgr::listenToMulticastGroup(), netRead(), DtConnectionMgr::readFileDescriptor(), send(), DtConnectionMgr::updateBufferSizes(), DtAsyncConnectionMgr::workerThread(), and DtSmConnectionMgr::~DtSmConnectionMgr().
bool DtRtiConnection::myCheckSize [protected] |
Referenced by disableCheckSize(), enableCheckSize(), and netRead().
bool DtRtiConnection::myCheckVersion [protected] |
Referenced by checkVersion(), and setCheckVersion().
unsigned long DtRtiConnection::myConnId [protected] |
Win32 only.
Referenced by connId(), and setConnId().
int DtRtiConnection::myFedExHandle [protected] |
Referenced by fedExHandle(), init(), netRead(), and setFedExHandle().
MAKRti::DtString DtRtiConnection::myFedExName [protected] |
Referenced by fedExName(), init(), netRead(), and setFedExName().
DtFederationHandle DtRtiConnection::myFedHandle [protected] |
Referenced by federateHandle(), init(), and setFederateHandle().
DtRtiMsgFactory* DtRtiConnection::myMsgFact [protected] |
Referenced by init(), rtiMsgFactory(), and setMsgFactory().
unsigned long DtRtiConnection::myReceivedMsgCount [protected] |
DtMsgSocket* DtRtiConnection::mySocket [protected] |
unsigned int DtRtiConnection::myWaitEventIndex [protected] |