VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
localExtendedPropertiesNetInterface.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 
16 #include <vrfStateData/stateData.h>
21 #include <vl/exerciseConn.h>
22 #include <vl/fom.h>
23 
24 #ifdef DtHLA
27 #else
29 #endif
30 
31 namespace makVrf
32 {
33  class DtSimObjectNetInterface;
34  class DtVrlinkNetworkInterface;
35 
38  template <typename BaseNetInterface, typename StateRepository>
40  {
41  private:
42 
45 
49 
51  const DtLocalExtendedPropertiesNetInterface & operator=(const
53 
54  public:
55 
58  bool publishObject = true)
59  : BaseNetInterface(vrfObject, objMgr, publishObject)
60  , myIsUninitialized(true)
61  {
62  }
63 
66  {
67  }
68 
70  virtual bool initExtendedProperties()
71  {
72  bool result = true;
73 
74  StateRepository* netWithProps = dynamic_cast<StateRepository*>(this->myNetworkState);
75 
76  if (netWithProps)
77  {
78  #ifdef DtDIS
79  netWithProps->setSendVrfObjectDataRecord(false);
80  #else
81  RTI::ObjectClassHandle hdl = this->objectClassHandle();
84  netWithProps->setObjectClassHandle(hdl);
85 
87  this->myObjectManager->exerciseConnection()))
88  {
89  netWithProps->setSendVrfObjectDataRecord(false);
90  }
91  else
92  {
93  DtWarn << "Unable to publish VrfExtendedAttributes, using VRF object data messages instead." << std::endl;
94  }
95  #endif
96  }
97 
98  myIsUninitialized = false;
99 
100  return result;
101  }
102 
103  #if DtHLA
104  virtual void onTick()
106  {
107  BaseNetInterface::onTick();
108  }
109  #endif
110 
113  virtual void updatePublisher()
114  {
115  if (myIsUninitialized)
116  {
117  initExtendedProperties();
118  }
119 
120  BaseNetInterface::updatePublisher();
121  }
122 
123  virtual void updateUuid()
124  {
125  StateRepository* netWithProps = dynamic_cast<StateRepository*>(this->myNetworkState);
126 
127  if (netWithProps && !netWithProps->shouldSendVrfObjectDataRecord())
128  {
129  const DtExternalCurrentFrameState* cfs = this->vrfObject()->currentFrameState();
131  netWithProps->setUuidString(eid->uuid().uuidString());
132  }
133  else
134  {
135  BaseNetInterface::updateUuid();
136  }
137  }
138 
140  bool publishObject)
141  {
143  publishObject);
144  }
145 
146 
147  protected:
149  };
150 }
const T_Component * getStateComponent(int index=0) const
The current state frame data.
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
Contains Extended DI-Guy Object net types.
virtual bool initExtendedProperties()
Initializer.
Definition: localExtendedPropertiesNetInterface.h:70
Contains the DtSensorFieldOfViewPublisher class declaration.
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
Extends an existing local net interface class to give it the ability to publish extended properties...
Definition: localExtendedPropertiesNetInterface.h:39
Class Description: DtSimObjectNetInterface.
Definition: simObjectNetInterface.h:48
DtLocalExtendedPropertiesNetInterface(DtStateData *vrfObject, DtVrlinkNetworkInterface *objMgr, bool publishObject=true)
read/writable constructor
Definition: localExtendedPropertiesNetInterface.h:57
Definition: stateData.h:260
virtual ~DtLocalExtendedPropertiesNetInterface()
destructor
Definition: localExtendedPropertiesNetInterface.h:65
Defines the DtPropertyInterface class, the interface for all property classes.
static DtSimObjectNetInterface * creator(DtStateData *vrfObject, DtVrlinkNetworkInterface *objMgr, bool publishObject)
Definition: localExtendedPropertiesNetInterface.h:139
bool myIsUninitialized
Definition: localExtendedPropertiesNetInterface.h:148
virtual void updateUuid()
Definition: localExtendedPropertiesNetInterface.h:123
virtual void updatePublisher()
Calls the base class updatePublisher() and then updates the extended property attributes.
Definition: localExtendedPropertiesNetInterface.h:113

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)