VR-Forces 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 
83  this->myObjectManager->exerciseConnection()))
84  {
85  netWithProps->setSendVrfObjectDataRecord(false);
86  }
87  else
88  {
89  DtWarn << "Unable to publish VrfExtendedAttributes, using VRF object data messages instead." << std::endl;
90  }
91  #endif
92  }
93 
94  myIsUninitialized = false;
95 
96  return result;
97  }
98 
99  #if DtHLA
100  virtual void onTick()
102  {
103  BaseNetInterface::onTick();
104  }
105  #endif
106 
109  virtual void updatePublisher()
110  {
111  if (myIsUninitialized)
112  {
113  initExtendedProperties();
114  }
115 
116  BaseNetInterface::updatePublisher();
117  }
118 
119  virtual void updateUuid()
120  {
121  StateRepository* netWithProps = dynamic_cast<StateRepository*>(this->myNetworkState);
122 
123  if (netWithProps && !netWithProps->shouldSendVrfObjectDataRecord())
124  {
125  const DtExternalCurrentFrameState* cfs = this->vrfObject()->currentFrameState();
127  netWithProps->setUniqueId(eid->uuid().vrlUuid());
128  }
129  else
130  {
131  BaseNetInterface::updateUuid();
132  }
133  }
134 
136  bool publishObject)
137  {
139  publishObject);
140  }
141 
142 
143  protected:
145  };
146 }
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:339
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:50
DtLocalExtendedPropertiesNetInterface(DtStateData *vrfObject, DtVrlinkNetworkInterface *objMgr, bool publishObject=true)
read/writable constructor
Definition: localExtendedPropertiesNetInterface.h:57
Definition: stateData.h:263
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:135
bool myIsUninitialized
Definition: localExtendedPropertiesNetInterface.h:144
virtual void updateUuid()
Definition: localExtendedPropertiesNetInterface.h:119
virtual void updatePublisher()
Calls the base class updatePublisher() and then updates the extended property attributes.
Definition: localExtendedPropertiesNetInterface.h:109

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)