VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtNetworkInterfaceManager Class Reference

The DtNetworkInterfaceManager manages all network interfaces utilized by the sim engine. Often there is only one, but it is possible for there to be multiple. Each network interface is an instance of a subclass of DtNetworkManagerInterface. As state data is created or removed, the DtNetworkInterfaceManager will notify each of its network interfaces, so that they may create object network interfaces to output required state data to the network.

Public Member Functions

 DtNetworkInterfaceManager (makVrf::DtStateDataManager *)
 
virtual ~DtNetworkInterfaceManager ()
 
makVrf::DtStateDataManagerstateDataManager () const
 
virtual void beginFrame (double simTime, double dt)
 
double simTime () const
 
double dT () const
 
virtual bool isConnectionless () const
 
virtual bool preAdvanceFrame ()
 
virtual void advanceFrame (double *networkFrameTime=nullptr)
 
virtual DtString nextEventId (const DtString &=DtString::nullString())
 
virtual bool insertManagerAtBeginning (DtNetworkManagerInterface *)
 
virtual void setNumCallbackThreads (unsigned)
 
virtual std::string protocol () const
 
virtual bool addManager (DtNetworkManagerInterface *)
 
virtual void removeManager (const char *)
 
virtual bool hasNetworkManager (const char *) const
 
virtual bool typeIsPublishable (const DtEntityType &) const
 
virtual DtNetworkManagerInterfacenetworkManagerInterface (const char *) const
 
virtual void printDataToStream (const DtUUID &, DtOutputStream &) const
 
virtual void setInterest (const DtVector &geocentricCenter, double radius)
 
virtual void reserve (unsigned numToReserve)
 
virtual void printReflectedObjectCounts () const
 
virtual void requestUpdatesForRemoteNonVrfObjects () const
 
virtual void setCommunicationManager (DtCommunicationManager *)
 
DtCommunicationManagercommunicationManager ()
 
virtual void setEnabled (bool)
 
bool enabled () const
 
virtual const makVrf::DtStateDatastateDataForGlobalId (const DtString &) const
 
virtual void setRunFullyThreaded (bool)
 
bool runFullyThreaded () const
 
virtual void setCoordinateSystem (const Coordinate_System *)
 
virtual void setParameterDatabase (DtVrfParameterDb *)
 
virtual unsigned int maxNameLengthForType (const DtObjectType &) const
 
virtual void setVrfSessionId (int)
 
virtual void setVrfMessageVersionSupported (int)
 
int vrfMessageVersionSupported () const
 
virtual void startScenarioLoad (bool)
 
virtual void endScenarioLoad (bool)
 
virtual void setFrameRateMode (const DtString &mode, double deltaTime, bool manageTime=false)
 
virtual void rewindScenario ()
 
virtual void run ()
 
virtual void pause ()
 
virtual void setExerciseStartTime (double)
 
virtual void setSimTime (double)
 
virtual void setTimeMultiplier (double)
 
virtual void setSiteAppId (int, int)
 
const DtSimulationAddress & simulationAddress () const
 
int numManagers () const
 
virtual double determineSimTime (double &dt)
 
virtual void addEvent (const makVrfEvents::DtEvent &, bool &selfReflected)
 
virtual void sendEvent (const makVrfEvents::DtEvent &)
 
virtual void setEventManager (makVrfEvents::DtEventManager *)
 
virtual void resetSimulation ()
 
virtual bool validateScenario (const DtScenario &, DtString &error) const
 
virtual void removeAndDeleteAll ()
 
virtual bool needsUnpublishedDatabase () const
 
virtual bool publishingOnLegionNetwork () const
 
virtual bool selfReflecting () const
 
virtual void setSelfReflecting (bool)
 
virtual bool rediscoverObjects ()
 
virtual void beginBulkCreate ()
 
virtual void endBulkCreate ()
 

Static Public Member Functions

static void setNetworkInterfaceManagerCreatorFcn (DtNetworkInterfaceManagerCreatorFcn fcn)
 
static DtNetworkInterfaceManagercreateNetworkInterfaceManager (makVrf::DtStateDataManager *)
 

Public Attributes

boost::signals2::signal< void(DtNetworkManagerInterface *)> signal_interfaceAdded
 
boost::signals2::signal< void(DtNetworkManagerInterface *)> signal_interfaceRemoved
 

Protected Member Functions

virtual void slot_stateDataAdded (makVrf::DtStateData *)
 
virtual void slot_stateDataAboutToBeRemoved (const makVrf::DtStateData *)
 
virtual void initialize (DtNetworkManagerInterface *)
 

Protected Attributes

std::vector
< DtNetworkManagerInterface * > 
myNetworkManagers
 
makVrf::DtStateDataManagermyStateDataManager
 
bool myRunFullyThreaded
 
bool myEnabled
 
const Coordinate_SystemmyCoordinateSystem
 
bool myOwnsCoordinateSystem
 
DtVrfParameterDbmyParameterDb
 
int myVrfSessionId
 
int myVrfMessageVersionSupported
 
DtSimulationAddress mySimulationAddress
 
int myNumberOfCallbackThreads
 
double mySimTime
 
double myDt
 
DtString myFrameRateMode
 
double myFrameDeltaTime
 
makVrfEvents::DtEventManagermyEventManager
 
DtCommunicationManagermyCommunicationManager
 
boost::signals2::scoped_connection myStateDataAddedConnection
 
boost::signals2::scoped_connection myStateDataRemovedConnection
 

Static Protected Attributes

static
DtNetworkInterfaceManagerCreatorFcn 
theNetworkInterfaceManagerCreatorFcn
 

Constructor & Destructor Documentation

DtNetworkInterfaceManager::DtNetworkInterfaceManager ( makVrf::DtStateDataManager )

constructor

virtual DtNetworkInterfaceManager::~DtNetworkInterfaceManager ( )
virtual

Member Function Documentation

static void DtNetworkInterfaceManager::setNetworkInterfaceManagerCreatorFcn ( DtNetworkInterfaceManagerCreatorFcn  fcn)
static

Factory method for creating this class. If no factory method defined the default DtNetworkInterfaceManager is created.

static DtNetworkInterfaceManager* DtNetworkInterfaceManager::createNetworkInterfaceManager ( makVrf::DtStateDataManager )
static

Factory method for creating this class. If no factory method defined the default DtNetworkInterfaceManager is created.

makVrf::DtStateDataManager* DtNetworkInterfaceManager::stateDataManager ( ) const
inline
virtual void DtNetworkInterfaceManager::beginFrame ( double  simTime,
double  dt 
)
virtual

Tells all network interfaces the frame is beginning. Returns the new sim time for this frame.

double DtNetworkInterfaceManager::simTime ( ) const
inline
double DtNetworkInterfaceManager::dT ( ) const
inline
virtual bool DtNetworkInterfaceManager::isConnectionless ( ) const
virtual

Returns true if there are no registered connections.

virtual bool DtNetworkInterfaceManager::preAdvanceFrame ( )
virtual

Tells all network interfaces the frame wants to be advanced. Called before the state data manager is advanced. Return false to not continue advancing frame. This can be useful if the network is still processing and the application doesn't want to block.

virtual void DtNetworkInterfaceManager::advanceFrame ( double networkFrameTime = nullptr)
virtual

Tells all network interfaces the frame wants to be advanced. Called after state data manager is advanced. Supply networkFrameTime pointer to get performance stats of time spent in network frame.

virtual DtString DtNetworkInterfaceManager::nextEventId ( const DtString = DtString::nullString())
virtual

Fire/detonate (and other) pdus/interactions can be tied with an event id. This routine will return the event id in a protocol dependent way based on the communication interface. Pass in the optional entity id of the entity causing the event.

virtual bool DtNetworkInterfaceManager::insertManagerAtBeginning ( DtNetworkManagerInterface )
virtual

Since the network interfaces will be walked in order to see if one wants to put it on the network to prevent other interfaces from also publishing on the network, insert this at the beginning to give it priority. This class will take ownership of the manager. If the manager type already exists, existing type is deleted.

virtual void DtNetworkInterfaceManager::setNumCallbackThreads ( unsigned  )
virtual

If supported, number of network threads to use.

virtual std::string DtNetworkInterfaceManager::protocol ( ) const
virtual

Returns the protocol of the first driver.

virtual bool DtNetworkInterfaceManager::addManager ( DtNetworkManagerInterface )
virtual

This class will take ownership of the manager. If the manager type already exists, existing type is deleted.

virtual void DtNetworkInterfaceManager::removeManager ( const char )
virtual

Removes and deletes the manager.

virtual bool DtNetworkInterfaceManager::hasNetworkManager ( const char ) const
virtual

Returns true if this class already has the network manager.

virtual bool DtNetworkInterfaceManager::typeIsPublishable ( const DtEntityType &  ) const
virtual

Returns true if the entity type is publishable by this connection.

virtual DtNetworkManagerInterface* DtNetworkInterfaceManager::networkManagerInterface ( const char ) const
virtual

Returns the network manager by type.

virtual void DtNetworkInterfaceManager::printDataToStream ( const DtUUID ,
DtOutputStream &   
) const
virtual

Sees which interface is handing this data and print any information that it wants to the given stream.

virtual void DtNetworkInterfaceManager::setInterest ( const DtVector geocentricCenter,
double  radius 
)
virtual

In case network interfaces care, the origin and radius of interest of this server.

virtual void DtNetworkInterfaceManager::reserve ( unsigned  numToReserve)
virtual

Connector dependent. Reserve the number of objects to be created.

virtual void DtNetworkInterfaceManager::printReflectedObjectCounts ( ) const
virtual

Requests each network interface to print their non locally simulated object counts to the screen.

virtual void DtNetworkInterfaceManager::requestUpdatesForRemoteNonVrfObjects ( ) const
virtual

If there are objects on other simulation systems, and the network protocol supports the request, request to force an update of any non simulated VR-Forces object.

virtual void DtNetworkInterfaceManager::setCommunicationManager ( DtCommunicationManager )
virtual
DtCommunicationManager* DtNetworkInterfaceManager::communicationManager ( )
inline
virtual void DtNetworkInterfaceManager::setEnabled ( bool  )
virtual

Whether or not the communication manager is enabled for receiving information.

bool DtNetworkInterfaceManager::enabled ( ) const
inline
virtual const makVrf::DtStateData* DtNetworkInterfaceManager::stateDataForGlobalId ( const DtString ) const
virtual

Given the global object designator, return the state data associated with it.

virtual void DtNetworkInterfaceManager::setRunFullyThreaded ( bool  )
virtual

Whether or not to run fully threaded.

bool DtNetworkInterfaceManager::runFullyThreaded ( ) const
inline
virtual void DtNetworkInterfaceManager::setCoordinateSystem ( const Coordinate_System )
virtual

Sets coordinate system into network connections.

virtual void DtNetworkInterfaceManager::setParameterDatabase ( DtVrfParameterDb )
virtual

Sets the VRF parameter database (if needed)

virtual unsigned int DtNetworkInterfaceManager::maxNameLengthForType ( const DtObjectType ) const
virtual

If the network interface supports it, the maximum name of a marking text.

virtual void DtNetworkInterfaceManager::setVrfSessionId ( int  )
virtual

If used, the session id this VRF session is in.

virtual void DtNetworkInterfaceManager::setVrfMessageVersionSupported ( int  )
virtual

If used the message version this VRF session uses.

int DtNetworkInterfaceManager::vrfMessageVersionSupported ( ) const
inline
virtual void DtNetworkInterfaceManager::startScenarioLoad ( bool  )
virtual

Called when starting scenario load. True is passed in to reuse identifiers if network dependent.

virtual void DtNetworkInterfaceManager::endScenarioLoad ( bool  )
virtual

Called when ending scenario load. True is passed in to reuse identifiers if network dependent.

virtual void DtNetworkInterfaceManager::setFrameRateMode ( const DtString mode,
double  deltaTime,
bool  manageTime = false 
)
virtual

Sets the mode for the exercise clock.

virtual void DtNetworkInterfaceManager::rewindScenario ( )
virtual

Called when the scenario is rewound.

virtual void DtNetworkInterfaceManager::run ( )
virtual

Puts the simulation into run mode by letting the network connections know.

virtual void DtNetworkInterfaceManager::pause ( )
virtual

Puts the simulation into pause mode by letting the network connections know.

virtual void DtNetworkInterfaceManager::setExerciseStartTime ( double  )
virtual

Start day/date time of the exercise.

virtual void DtNetworkInterfaceManager::setSimTime ( double  )
virtual

Sets the current simulation time.

virtual void DtNetworkInterfaceManager::setTimeMultiplier ( double  )
virtual

Sets the current time multiplier.

virtual void DtNetworkInterfaceManager::setSiteAppId ( int  ,
int   
)
virtual

The site and app id of this back-end.

const DtSimulationAddress& DtNetworkInterfaceManager::simulationAddress ( ) const
inline
int DtNetworkInterfaceManager::numManagers ( ) const
inline
virtual double DtNetworkInterfaceManager::determineSimTime ( double dt)
virtual

Determines the simulation time for this frame.

virtual void DtNetworkInterfaceManager::addEvent ( const makVrfEvents::DtEvent ,
bool selfReflected 
)
virtual

Passes the event to the network interfaces for possible handling. selfReflected will return true if the act of adding the event also adds it to the event manager as a process of sending on the network.

virtual void DtNetworkInterfaceManager::sendEvent ( const makVrfEvents::DtEvent )
virtual

Sends the event on network only. Does not add to event manager even if self reflected.

virtual void DtNetworkInterfaceManager::setEventManager ( makVrfEvents::DtEventManager )
virtual

Sets the event manager to use in case of remote events coming over the network to post to.

virtual void DtNetworkInterfaceManager::resetSimulation ( )
virtual

Called when the simulation is ending and wants to reset.

virtual bool DtNetworkInterfaceManager::validateScenario ( const DtScenario ,
DtString error 
) const
virtual

If any of the network connections return false, this scenario is not valid.

virtual void DtNetworkInterfaceManager::removeAndDeleteAll ( )
virtual

Called when all objects are being deleted, will indicate that all remotes will eventually need to be rediscovered.

virtual bool DtNetworkInterfaceManager::needsUnpublishedDatabase ( ) const
virtual

Return true if this connection uses the simulation database to publish on (as a legion connection does). If so then this connection will also need to let the system know it needs to provide an unpublished database.

virtual bool DtNetworkInterfaceManager::publishingOnLegionNetwork ( ) const
virtual

Whether or not any of the network interfaces will publish on the legion network.

virtual bool DtNetworkInterfaceManager::selfReflecting ( ) const
virtual

Returns true if any of the connections are self reflecting.

virtual void DtNetworkInterfaceManager::setSelfReflecting ( bool  )
virtual

Sets all connections (if supported) to self reflecting. This will only apply to current handlers, not ones that are added after this is called.

virtual bool DtNetworkInterfaceManager::rediscoverObjects ( )
virtual

Passes down to the network interfaces to recreate any state data for remote objects.

virtual void DtNetworkInterfaceManager::beginBulkCreate ( )
virtual
virtual void DtNetworkInterfaceManager::endBulkCreate ( )
virtual
virtual void DtNetworkInterfaceManager::slot_stateDataAdded ( makVrf::DtStateData )
protectedvirtual

See what network interface wants to handle this add. Once does others are not given a chance.

virtual void DtNetworkInterfaceManager::slot_stateDataAboutToBeRemoved ( const makVrf::DtStateData )
protectedvirtual

Call each network interface for the removal.

virtual void DtNetworkInterfaceManager::initialize ( DtNetworkManagerInterface )
protectedvirtual

Initializes interface with current settings.

Member Data Documentation

boost::signals2::signal<void (DtNetworkManagerInterface*)> DtNetworkInterfaceManager::signal_interfaceAdded

Signal sent when an interface is added.

boost::signals2::signal<void (DtNetworkManagerInterface*)> DtNetworkInterfaceManager::signal_interfaceRemoved

Signal sent when an interface is removed.

std::vector<DtNetworkManagerInterface*> DtNetworkInterfaceManager::myNetworkManagers
protected
makVrf::DtStateDataManager* DtNetworkInterfaceManager::myStateDataManager
protected
bool DtNetworkInterfaceManager::myRunFullyThreaded
protected
bool DtNetworkInterfaceManager::myEnabled
protected
const Coordinate_System* DtNetworkInterfaceManager::myCoordinateSystem
protected
bool DtNetworkInterfaceManager::myOwnsCoordinateSystem
protected
DtVrfParameterDb* DtNetworkInterfaceManager::myParameterDb
protected
int DtNetworkInterfaceManager::myVrfSessionId
protected
int DtNetworkInterfaceManager::myVrfMessageVersionSupported
protected
DtSimulationAddress DtNetworkInterfaceManager::mySimulationAddress
protected
int DtNetworkInterfaceManager::myNumberOfCallbackThreads
protected
double DtNetworkInterfaceManager::mySimTime
protected
double DtNetworkInterfaceManager::myDt
protected
DtString DtNetworkInterfaceManager::myFrameRateMode
protected
double DtNetworkInterfaceManager::myFrameDeltaTime
protected
makVrfEvents::DtEventManager* DtNetworkInterfaceManager::myEventManager
protected
DtNetworkInterfaceManagerCreatorFcn DtNetworkInterfaceManager::theNetworkInterfaceManagerCreatorFcn
staticprotected
DtCommunicationManager* DtNetworkInterfaceManager::myCommunicationManager
protected
boost::signals2::scoped_connection DtNetworkInterfaceManager::myStateDataAddedConnection
protected
boost::signals2::scoped_connection DtNetworkInterfaceManager::myStateDataRemovedConnection
protected

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)