|
VR-Engage
2.2
|
Publishers manage updating CIGI data, tracking dirty state, and writing to CigiOutgoingMsg when values have changed. Publishers can be parented to other Publishers, and parent Publishers init, tick, and publish their children.
#include <cigiPublisherBase.h>
Public Member Functions | |
| DtCigiPublisherBase () | |
| virtual | ~DtCigiPublisherBase () override |
| DtCigiDataBase * | shared () |
| DtCigiDataBase *const | shared () const |
| virtual bool | init () override |
| virtual void | setEnabled (bool enabled) |
| virtual bool | enabled () const |
| virtual void | tick (double dt) |
| template<class CHILD_T> | |
| std::shared_ptr< CHILD_T > | addNewChild (const std::string &name="") |
| virtual bool | addChild (Sptr child) override |
| virtual void | publish (CigiOutgoingMsg &out) |
| virtual void | setNeedsReceiptConfirmation (bool needs) |
| virtual bool | needsReceiptConfirmation () const |
| virtual void | receiptConfirmed () |
| virtual double | lastSent () |
| virtual void | markDirty (bool childrenToo=false) |
| virtual void | markClean (bool childrenToo=false) |
Public Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > > | |
| DtSpSubClass () | |
| virtual | ~DtSpSubClass () |
| Sptr | self () |
| std::string | type () const override |
Public Member Functions inherited from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > | |
| DtTreeClass () | |
| virtual | ~DtTreeClass () override |
| virtual void | setOwnsChildren (bool owns) |
| virtual bool | ownsChildren () |
| virtual bool | removeChild (Sptr child) |
| virtual void | removeAllChildren () |
| virtual bool | forEachChild (ForChildFn fn) |
| virtual Sptr | findChild (FindChildFn fn) |
| virtual Sptr | findChild (const std::string &name) |
| virtual bool | isChild (Sptr child) |
| virtual unsigned int | numChildren () |
| virtual bool | hasChildren () |
| virtual Sptr | parent () |
Public Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtCigiObjectBase > | |
| DtSpSubClass () | |
| Sptr | self () |
Public Member Functions inherited from makVre::DtCigiObjectBase | |
| DtCigiObjectBase () | |
| virtual | ~DtCigiObjectBase () override |
| CigiData * | cigi () |
| CigiData *const | cigi () const |
| virtual Cigi_uint16 | cigiType () |
| virtual Sptr | setSession (DtCigiSession &session) |
| virtual DtCigiSession & | session () const |
| virtual unsigned int | sessionVersion () const |
| virtual void | markDirty () |
| virtual void | markClean () |
| virtual bool | isDirty () const |
Public Member Functions inherited from makVre::DtSpSubClass< DtCigiObjectBase > | |
| DtSpSubClass () | |
| Sptr | self () |
Public Member Functions inherited from makVre::DtSpObject | |
| DtSpObject () | |
| virtual | ~DtSpObject () |
| Sptr | self () |
| virtual void | setName (const std::string &name) |
| virtual std::string | name () const |
Protected Member Functions | |
| virtual std::string | sharedKey () |
| virtual void | setupShared () |
| virtual bool | verifySharedType ()=0 |
| virtual void | initShared () |
| virtual void | initCigi () |
| virtual void | updateShared () |
| virtual void | updateCigi () |
| virtual void | write (CigiOutgoingMsg &out) |
| virtual void | createChildren () |
| virtual void | tickChildren (double dt) |
| virtual void | publishChildren (CigiOutgoingMsg &out) |
Protected Member Functions inherited from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > | |
| virtual void | setParent (Sptr parent) |
| virtual void | pruneChildren () |
Protected Member Functions inherited from makVre::DtCigiObjectBase | |
| virtual DtCigiDataBase * | createCigi ()=0 |
| DtCigiDataBase * | cigiBase () |
| DtCigiDataBase *const | cigiBase () const |
| template<typename VALUE_T> | |
| bool | updateValue (VALUE_T *value, VALUE_T source) |
Protected Attributes | |
| CigiBasePtr | mySharedData |
| bool | myEnabled |
| bool | myNeedsConfirmation |
| double | myLastSentToIg |
Protected Attributes inherited from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > | |
| OwnedChildList | myOwnedChildren |
| UnownedChildList | myUnownedChildren |
| ChildNameMap | myChildrenByName |
| bool | myOwnsChildren |
| Wptr | myParent |
Protected Attributes inherited from makVre::DtCigiObjectBase | |
| CigiBasePtr | myCigiData |
| DtCigiSession * | mySession |
| bool | myDirty |
Protected Attributes inherited from makVre::DtSpObject | |
| std::string | myName |
Additional Inherited Members | |
Public Types inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > > | |
| using | Super |
| using | Ptr |
| using | Sptr |
| using | Wptr |
Public Types inherited from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > | |
| using | Sptr |
| using | ForChildFn |
| using | FindChildFn |
Public Types inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtCigiObjectBase > | |
| using | Super |
| using | Ptr |
| using | Sptr |
| using | Wptr |
Public Types inherited from makVre::DtCigiObjectBase | |
| using | Cigi = CigiBasePacket |
| using | CigiData = DtCigiDataTemplate<CigiBasePacket, DtCigiObjectBase> |
| using | CigiBasePtr = std::shared_ptr<DtCigiDataBase> |
Public Types inherited from makVre::DtSpSubClass< DtCigiObjectBase > | |
| using | Super |
| using | Ptr |
| using | Sptr |
| using | Wptr |
Public Types inherited from makVre::DtSpObject | |
| using | Ptr = DtSpObject* |
| using | Sptr = std::shared_ptr<DtSpObject> |
| using | Wptr = std::weak_ptr<DtSpObject> |
Static Public Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > > | |
| static std::string | Type () |
| static std::shared_ptr< DtCigiPublisherBase > | create () |
| static void | registerCreator () |
| static std::shared_ptr< DtCigiPublisherBase > | createVersion (unsigned int version) |
| static void | registerCreatorVersion (unsigned int version) |
Static Public Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtCigiObjectBase > | |
| static std::string | Type () |
| static std::shared_ptr< DtCigiPublisherBase > | create () |
| static void | registerCreator () |
| static std::shared_ptr< DtCigiPublisherBase > | createVersion (unsigned int version) |
| static void | registerCreatorVersion (unsigned int version) |
Static Public Member Functions inherited from makVre::DtSpSubClass< DtCigiObjectBase > | |
| static std::string | Type () |
| static std::shared_ptr< DtCigiObjectBase > | create () |
| static void | registerCreator () |
| static std::shared_ptr< DtCigiObjectBase > | createVersion (unsigned int version) |
| static void | registerCreatorVersion (unsigned int version) |
Static Public Member Functions inherited from makVre::DtSpObject | |
| template<class AS_T> | |
| static std::shared_ptr< AS_T > | cast (Sptr p) |
| template<class AS_T> | |
| static std::shared_ptr< AS_T > | unsafe_cast (Sptr p) |
Protected Types inherited from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > | |
| using | Wptr |
| using | OwnedChildList |
| using | UnownedChildList |
| using | ChildNameMap |
Static Protected Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > > | |
| static std::shared_ptr< DtBaseCreator< DtCigiPublisherBase > > & | creator () |
| static std::shared_ptr< DtBaseCreator< DtCigiPublisherBase > > & | creatorVersion (unsigned int version) |
Static Protected Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtCigiObjectBase > | |
| static std::shared_ptr< DtBaseCreator< DtCigiPublisherBase > > & | creator () |
| static std::shared_ptr< DtBaseCreator< DtCigiPublisherBase > > & | creatorVersion (unsigned int version) |
Static Protected Member Functions inherited from makVre::DtSpSubClass< DtCigiObjectBase > | |
| static std::shared_ptr< DtBaseCreator< DtCigiObjectBase > > & | creator () |
| static std::shared_ptr< DtBaseCreator< DtCigiObjectBase > > & | creatorVersion (unsigned int version) |
| makVre::DtCigiPublisherBase::DtCigiPublisherBase | ( | ) |
|
inlineoverridevirtual |
| DtCigiDataBase * makVre::DtCigiPublisherBase::shared | ( | ) |
Get pointer to shared CIGI packet data object.
Shared data allows Publishers in different Sessions publishing data for the same Sim entity to share common data which only needs to be updated once per Sim frame.
| DtCigiDataBase *const makVre::DtCigiPublisherBase::shared | ( | ) | const |
|
overridevirtual |
Reimplemented from makVre::DtCigiObjectBase.
Reimplemented in makVre::DtCigiEntityPublisherBase, makVre::DtCigiEntityUnpublisher, makVre::DtCigiIgControlPublisher, makVre::DtCigiPublisherGroup, makVre::DtCigiSimObjectPublisherBase, makVre::DtCigiTimePublisher, makVre::DtCigiViewControlPublisher, and makVre::DtCigiViewDefinitionPublisher.
|
virtual |
Enable or disable this Publisher.
Tick and publish are suppressed when disabled.
References enabled().
|
virtual |
Referenced by setEnabled().
|
virtual |
Reimplemented in makVre::DtCigiFxPublisher, makVre::DtCigiTimePublisher, and makVre::DtCigiViewControlPublisher.
|
inline |
Convenience wrapper for creating, naming, and adding a child Publisher instance of type CHILD_T.
References addChild(), makVre::DtSpObject::name(), and makVre::DtCigiObjectBase::sessionVersion().
|
overridevirtual |
Adds publisher as child of this Publisher.
Child will be re-parented to this. Publishers may have only one parent.
| child | Pointer to Publisher to add as child. |
Reimplemented from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase >.
Referenced by addNewChild().
|
virtual |
Causes this Publisher to write CIGI packet data to out.
Invokes updateCigi() to make sure data is fresh and determine dirty state if not already dirty, then invokes write() to write data to CigiOutoingMsg if state is dirty.
| out | CigiOutgoingMsg to write CIGI packet data into. |
|
virtual |
Set/get whether this Publisher should get confirmation that IG has received the last frame where this Publisher wrote data during publish().
Set true when this publisher writes information that does not change often but should be delivered reliably. Publisher will be marked as dirty to force re-sending data if the frame containing the last write is not confimed to have been received by the IG.
|
virtual |
|
inlinevirtual |
Called when the IG reports receiving the last frame in which this Pulisher wrote data during publish().
This function is only called if needsReceiptConfirmation() is true.
Reimplemented in makVre::DtCigiEntityUnpublisher, and makVre::DtCigiFxPublisher.
|
virtual |
Returns the time that last update was sent during publish(). (as cgf->simulationServices()->elapsedRealTime())
|
virtual |
Explictly mark this publisher as dirty so that the data is guaranteed to be written during the next publish() call.
|
virtual |
Clear the dirty flag.
Note that this does not suppress the normal update mechanism. If the data has changed since the last publish() call, then this Publisher will again be marked as dirty the next time the publish() invokes updateCigi().
|
inlineprotectedvirtual |
Key to uniquely idenfity the shared data instance associated with the Sim object represented by this Publisher.
No shared data will be created if sharedKey returns an empty string, which is the default behavior if not overridden by the derived Publisher class. Derived Publishers should override this function and return a suitable key if they will be using shared data.
Reimplemented in makVre::DtCigiSimEntityArtPartPublisher, makVre::DtCigiSimEntityComponentPublisherBase, and makVre::DtCigiSimObjectPublisherBase.
|
protectedvirtual |
|
protectedpure virtual |
Implemented in makVre::DtCigiPublisherGroup, makVre::DtCigiPublisherTemplate< CIGI_T, SELF_T, SUPER_T, DATA_CREATOR_T >, makVre::DtCigiPublisherTemplate< CigiArtPartCtrlV4, DtCigiSimEntityArtPartPublisherV4, DtCigiSimEntityArtPartPublisher, DtCigiDataCreator >, makVre::DtCigiPublisherTemplate< CigiBaseArtPartCtrl, DtCigiSimEntityArtPartPublisher, DtCigiSimEntityComponentPublisherBase >, makVre::DtCigiPublisherTemplate< CigiBaseEntityCtrl, DtCigiEntityPublisherBase >, makVre::DtCigiPublisherTemplate< CigiBaseEntityCtrl, DtCigiEntityUnpublisher >, makVre::DtCigiPublisherTemplate< CigiBaseEntityCtrl, DtCigiFxPublisher, DtCigiEntityPublisherBase >, makVre::DtCigiPublisherTemplate< CigiBaseEntityCtrl, DtCigiSimEntityPublisher, DtCigiSimObjectPublisherBase >, makVre::DtCigiPublisherTemplate< CigiBaseEntityPositionCtrl, DtCigiFxPositionPublisher >, makVre::DtCigiPublisherTemplate< CigiBaseEntityPositionCtrl, DtCigiSimEntityPositionPublisher, DtCigiSimEntityComponentPublisherBase >, makVre::DtCigiPublisherTemplate< CigiBaseEnvCtrl, DtCigiTimePublisher, DtCigiPublisherBase >, makVre::DtCigiPublisherTemplate< CigiBaseIGCtrl, DtCigiIgControlPublisher >, makVre::DtCigiPublisherTemplate< CigiBaseRateCtrl, DtCigiFxVelocityPublisher >, makVre::DtCigiPublisherTemplate< CigiBaseRateCtrl, DtCigiSimEntityVelocityPublisher, DtCigiSimEntityComponentPublisherBase >, makVre::DtCigiPublisherTemplate< CigiBaseViewCtrl, DtCigiViewControlPublisher >, makVre::DtCigiPublisherTemplate< CigiBaseViewDef, DtCigiViewDefinitionPublisher >, makVre::DtCigiPublisherTemplate< CigiCelestialCtrlV4, DtCigiTimePublisherV4, DtCigiTimePublisher, DtCigiDataCreator >, makVre::DtCigiPublisherTemplate< CigiEntityCtrlV4, DtCigiEntityUnpublisherV4, DtCigiEntityUnpublisher, DtCigiDataCreator >, makVre::DtCigiPublisherTemplate< CigiEntityCtrlV4, DtCigiFxPublisherV4, DtCigiFxPublisher, DtCigiDataCreator >, makVre::DtCigiPublisherTemplate< CigiEntityCtrlV4, DtCigiSimEntityPublisherV4, DtCigiSimEntityPublisher, DtCigiDataCreator >, makVre::DtCigiPublisherTemplate< CigiEntityPositionCtrlV4, DtCigiFxPositionPublisherV4, DtCigiFxPositionPublisher, DtCigiDataCreator >, makVre::DtCigiPublisherTemplate< CigiEntityPositionCtrlV4, DtCigiSimEntityPositionPublisherV4, DtCigiSimEntityPositionPublisher, DtCigiDataCreator >, makVre::DtCigiPublisherTemplate< CigiIGCtrlV4, DtCigiIgControlPublisherV4, DtCigiIgControlPublisher, DtCigiDataCreator >, makVre::DtCigiPublisherTemplate< CigiVelocityCtrlV4, DtCigiFxVelocityPublisherV4, DtCigiFxVelocityPublisher, DtCigiDataCreator >, makVre::DtCigiPublisherTemplate< CigiVelocityCtrlV4, DtCigiSimEntityVelocityPublisherV4, DtCigiSimEntityVelocityPublisher, DtCigiDataCreator >, makVre::DtCigiPublisherTemplate< CigiViewCtrlV4, DtCigiViewControlPublisherV4, DtCigiViewControlPublisher, DtCigiDataCreator >, and makVre::DtCigiPublisherTemplate< CigiViewDefV4, DtCigiViewDefinitionPublisherV4, DtCigiViewDefinitionPublisher, DtCigiDataCreator >.
|
inlineprotectedvirtual |
Derived Publisher classes should override initShared() to set inital values in the shared CIGI data object.
Reimplemented in makVre::DtCigiSimEntityArtPartPublisher, makVre::DtCigiSimEntityPublisherV4, and makVre::DtCigiSimEntityVelocityPublisherV4.
|
inlineprotectedvirtual |
Derived Publisher classes should override initCigi() to set initial values in the CIGI data.
Reimplemented in makVre::DtCigiEntityPublisherBase, makVre::DtCigiEntityUnpublisherV4, makVre::DtCigiFxPublisher, makVre::DtCigiFxPublisherV4, makVre::DtCigiIgControlPublisherV4, makVre::DtCigiSimEntityArtPartPublisher, makVre::DtCigiSimEntityArtPartPublisherV4, makVre::DtCigiSimEntityComponentPublisherBase, makVre::DtCigiSimEntityPublisherV4, makVre::DtCigiTimePublisher, makVre::DtCigiViewControlPublisher, and makVre::DtCigiViewDefinitionPublisher.
|
inlineprotectedvirtual |
Derived Publisher classes should override updateShared() to update values in the shared CIGI data object.
updateShared() is called only by the first Publisher for each shared data instance to publish() during each Host frame.
Reimplemented in makVre::DtCigiSimEntityArtPartPublisher, makVre::DtCigiSimEntityPositionPublisher, makVre::DtCigiSimEntityPublisherV4, and makVre::DtCigiSimEntityVelocityPublisher.
|
inlineprotectedvirtual |
Derived Publisher classes should override updateCigi() to update values in the CIGI data.
If shared data is used, the expected pattern is to copy values from shared data into CIGI data at this point. updateShared() is called, if necessary, before updateCigi() so that shared data contains the most recent object state.
updateCigi() is called during publish(), before write(). updateCigi() is expected to set the dirty flag true if there are changes to the CIGI data. write() will be called only if this Publisher is marked dirty.
Reimplemented in makVre::DtCigiIgControlPublisher, makVre::DtCigiIgControlPublisherV4, makVre::DtCigiSimEntityArtPartPublisher, makVre::DtCigiSimEntityPositionPublisher, makVre::DtCigiSimEntityPublisherV4, makVre::DtCigiSimEntityVelocityPublisher, makVre::DtCigiTimePublisher, and makVre::DtCigiViewControlPublisher.
|
protectedvirtual |
Internal class function invoked from publish if state is dirty. Packs CIGI data into CigiOutgoingMsg.
Reimplemented in makVre::DtCigiPublisherGroup.
|
inlineprotectedvirtual |
Derived Publisher classes should override createChildre() to create child Publishers, if necessary.
createChildren() is called during init().
Reimplemented in makVre::DtCigiFxPublisher, makVre::DtCigiIgControlPublisher, and makVre::DtCigiSimEntityPublisher.
|
protectedvirtual |
Reimplemented in makVre::DtCigiEntityPublisherBase, makVre::DtCigiFxPublisher, and makVre::DtCigiIgControlPublisher.
|
protectedvirtual |
Reimplemented in makVre::DtCigiEntityPublisherBase, makVre::DtCigiFxPublisher, and makVre::DtCigiIgControlPublisher.
|
protected |
|
protected |
|
protected |
|
protected |