VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtSimRemoteEntityNetInterface Class Reference

Derived from DtSimEntityNetInterface, DtSimRemoteEntityNetInterface provides an interface between the local representation of a remote entity and it's network (VR-Link) representation. More...

Inheritance diagram for DtSimRemoteEntityNetInterface:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtSimRemoteEntityNetInterface (const DtString &name, DtVrfObject *simObject, DtReaderWriterRegistry *parentRegistry=0, bool publishObject=true)
 read/writable constructor
 DtSimRemoteEntityNetInterface (const DtSimRemoteEntityNetInterface &orig, DtReaderWriterRegistry *parentRegistry=0)
 copy constructor; NOTE: The publisher is not copied, because VR-Link does not provide a copy constructor (or clone or assignment function) for a publisher.
const
DtSimRemoteEntityNetInterface
operator= (const DtSimRemoteEntityNetInterface &orig)
 assignment operator; see note on copy constructor above
virtual ~DtSimRemoteEntityNetInterface ()
 destructor; calls destroyPublisher()
virtual bool init ()
 override of base class init().
virtual void onTick ()
 override of base class onTick(), calls updateFromReflectedObject()
virtual void updateFromReflectedObject ()=0
 this will copy from whatever type of reflected object and associated network state repository the deriving class uses to the local state repository
virtual void setupFromNetworkRepository ()
 initializes parts of the local repository from the network state rep.
virtual void setReflectedObject (DtReflectedObject *reflectedObject)
 For local entities, a publisher can be created or supplied via a set<>Publisher call.
virtual const DtReflectedObject * reflectedObject () const
virtual DtReflectedObject * reflectedObject ()
virtual bool isLocal () const
 This network interface is for local entities.
virtual bool isAggregate () const =0
virtual void setUpdateReceived (bool updateReceived)
 Setting update received to true will cause updateFromRemoteObject() to be called on the next tick.
virtual bool updateReceived () const
 Check to see if an update has been received from the network.

Static Public Member Functions

static const
DtSimRemoteEntityNetInterface
isRemoteEntityNetInterface (const DtSimObjectNetInterface *objNetInterface)
 This function will return the objNetInterface passed in, cast to a DtSimRemoteEntityNetInterface*, provided the objNetInterface is indeed an remote entity network interface.
static
DtSimRemoteEntityNetInterface
isRemoteEntityNetInterface (DtSimObjectNetInterface *objNetInterface)
static void reflectedObjectUpdateCallbackFunction (DtReflectedObject *obj, void *userData)

Protected Member Functions

 DtSimRemoteEntityNetInterface ()
 default constructor

Protected Attributes

DtReflectedObject * myReflectedObject
 Pointer to the VR-Link Reflected Object (may be a DtReflectedEntity, DtReflectedExtAggregate, etc.
bool myUpdateReceived
 Set to true by post-update callback; set to false after update has been processed.

Detailed Description

Derived from DtSimEntityNetInterface, DtSimRemoteEntityNetInterface provides an interface between the local representation of a remote entity and it's network (VR-Link) representation.

This is an abstract class whose deriving classes will represent different types of entities, such as individual, aggregate, and eventually, environmental


Constructor & Destructor Documentation

default constructor

DtSimRemoteEntityNetInterface::DtSimRemoteEntityNetInterface ( const DtString name,
DtVrfObject simObject,
DtReaderWriterRegistry parentRegistry = 0,
bool  publishObject = true 
)

read/writable constructor

copy constructor; NOTE: The publisher is not copied, because VR-Link does not provide a copy constructor (or clone or assignment function) for a publisher.

Therefore, you must call init() on the copy after construction, or call setPublisher() with a user constructed publisher

destructor; calls destroyPublisher()


Member Function Documentation

const DtSimRemoteEntityNetInterface& DtSimRemoteEntityNetInterface::operator= ( const DtSimRemoteEntityNetInterface orig)

assignment operator; see note on copy constructor above

override of base class init().

Registers for post update callbacks on reflected object.

Reimplemented from DtSimObjectNetInterface.

Reimplemented in DtVrfAggregateRemoteEntityNetInterface, and DtVrfIndividualRemoteEntityNetInterface.

virtual void DtSimRemoteEntityNetInterface::onTick ( ) [virtual]

this will copy from whatever type of reflected object and associated network state repository the deriving class uses to the local state repository

Implemented in DtVrfIndividualRemoteEntityNetInterface, DtSimAggregateRemoteEntityNetInterface, DtSimIndividualRemoteEntityNetInterface, and MyIndividualRemoteEntityNetInterface.

initializes parts of the local repository from the network state rep.

This needs to be done after the call to setReflectedObject()

virtual void DtSimRemoteEntityNetInterface::setReflectedObject ( DtReflectedObject *  reflectedObject) [virtual]

For local entities, a publisher can be created or supplied via a set<>Publisher call.

For remote entities a reflected object is used instead, and must always be supplied (there is no create equivalent to the local entity network interface). This function also sets the network state repository pointer (myBaseNetworkState) to the repository created by this reflected object

virtual const DtReflectedObject* DtSimRemoteEntityNetInterface::reflectedObject ( ) const [virtual]
Returns:
The pointer to the VR-Link reflected object being used to represent this remote entity
virtual DtReflectedObject* DtSimRemoteEntityNetInterface::reflectedObject ( ) [virtual]
virtual bool DtSimRemoteEntityNetInterface::isLocal ( ) const [inline, virtual]

This network interface is for local entities.

Implements DtSimObjectNetInterface.

virtual bool DtSimRemoteEntityNetInterface::isAggregate ( ) const [pure virtual]
virtual void DtSimRemoteEntityNetInterface::setUpdateReceived ( bool  updateReceived) [virtual]

Setting update received to true will cause updateFromRemoteObject() to be called on the next tick.

Check to see if an update has been received from the network.

This function will return the objNetInterface passed in, cast to a DtSimRemoteEntityNetInterface*, provided the objNetInterface is indeed an remote entity network interface.

static void DtSimRemoteEntityNetInterface::reflectedObjectUpdateCallbackFunction ( DtReflectedObject *  obj,
void *  userData 
) [static]

Member Data Documentation

DtReflectedObject* DtSimRemoteEntityNetInterface::myReflectedObject [protected]

Pointer to the VR-Link Reflected Object (may be a DtReflectedEntity, DtReflectedExtAggregate, etc.

).

Set to true by post-update callback; set to false after update has been processed.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)