VR-Forces 4.8 Class Documentation
 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 
15 #include <vrfobjcore/vrfObject.h>
17 #include <vrfcore/simManager.h>
22 #include <vl/exerciseConn.h>
23 #include <vl/fom.h>
24 
25 #ifdef DtHLA
28 #else
30 #endif
31 
34 template <typename BaseNetInterface, typename StateRepository>
36 {
37 protected:
38 
42  , myIsUninitialized(true)
43  {
44  }
45 
46 public:
47 
50  DtVrfObject* vrfObject,
51  DtReaderWriterRegistry* parentRegistry = 0,
52  bool publishObject = true)
53  : BaseNetInterface(name, vrfObject, parentRegistry, publishObject)
54  , myIsUninitialized(true)
55  {
56  }
57 
61  DtReaderWriterRegistry * parentRegistry = 0)
62  : BaseNetInterface(orig)
63  , myIsUninitialized(true)
64  {
65  }
66 
70  {
71  return static_cast<const DtLocalExtendedPropertiesNetInterface&>(
72  BaseNetInterface::operator=(orig));
73  }
74 
77  {
78  }
79 
81  virtual bool initExtendedProperties()
82  {
83  bool result = true;
84 
85  StateRepository* netWithProps = dynamic_cast<StateRepository*>(this->myNetworkState);
86 
87  DtVrfObjectStateRepository* localState = this->mySimObject->vrfState();
88 
89  if (netWithProps && localState)
90  {
91 #ifdef DtDIS
92  netWithProps->setSendVrfObjectDataRecord(false);
93 #else
94  RTI::ObjectClassHandle hdl = this->objectClassHandle();
97  netWithProps->setObjectClassHandle(hdl);
98 
100  this->mySimManager->exerciseConn()))
101  {
102  netWithProps->setSendVrfObjectDataRecord(false);
103  }
104  else
105  {
106  DtWarn << "Unable to publish VrfExtendedAttributes, using VRF object data messages instead." << std::endl;
107  }
108 #endif
109  }
110 
111  myIsUninitialized = false;
112 
113  return result;
114  }
115 
116 #if DtHLA
117  virtual void onTick()
119  {
120  BaseNetInterface::onTick();
121  }
122 #endif
123 
126  virtual void updatePublisher()
127  {
128  if (myIsUninitialized)
129  {
130  initExtendedProperties();
131  }
132 
133  BaseNetInterface::updatePublisher();
134  }
135 
136  virtual void updateUuid()
137  {
138  DtVrfObjectStateRepository* localState = this->mySimObject->vrfState();
139  StateRepository* netWithProps = dynamic_cast<StateRepository*>(this->myNetworkState);
140 
141  if (localState && netWithProps && !netWithProps->shouldSendVrfObjectDataRecord())
142  {
143  netWithProps->setUuidString(this->vrfObject()->uuid().uuidString());
144  }
145  else
146  {
147  BaseNetInterface::updateUuid();
148  }
149  }
150 
151  static DtSimObjectNetInterface * creator(const DtString & name,
152  DtVrfObject* vrfObject,
153  DtReaderWriterRegistry* parentRegistry,
154  bool publishObject)
155  {
157  parentRegistry, publishObject);
158  }
159 
160 
161 protected:
162 
164 
165 };
166 
Implements the DtLocalExtendedPropertiesNetInterface class template.
Definition: localExtendedPropertiesNetInterface.h:35
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtLocalExtendedPropertiesNetInterface(const DtLocalExtendedPropertiesNetInterface< BaseNetInterface, StateRepository > &orig, DtReaderWriterRegistry *parentRegistry=0)
copy constructor
Definition: localExtendedPropertiesNetInterface.h:59
Contains Extended DI-Guy Object net types.
virtual bool initExtendedProperties()
Initializer.
Definition: localExtendedPropertiesNetInterface.h:81
Definition: readerWriterRegistry.h:39
Contains the DtSensorFieldOfViewPublisher class declaration.
Description: This repository holds all information that is common to all the forms of all entity/aggr...
Definition: vrfObjectStateRepository.h:87
virtual ~DtLocalExtendedPropertiesNetInterface()
destructor
Definition: localExtendedPropertiesNetInterface.h:76
bool myIsUninitialized
Definition: localExtendedPropertiesNetInterface.h:163
const DtLocalExtendedPropertiesNetInterface & operator=(const DtLocalExtendedPropertiesNetInterface< BaseNetInterface, StateRepository > &orig)
assignment operator
Definition: localExtendedPropertiesNetInterface.h:68
DtLocalExtendedPropertiesNetInterface(const DtString &name, DtVrfObject *vrfObject, DtReaderWriterRegistry *parentRegistry=0, bool publishObject=true)
read/writable constructor
Definition: localExtendedPropertiesNetInterface.h:49
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
virtual void updatePublisher()
Calls the base class updatePublisher() and then updates the extended property attributes.
Definition: localExtendedPropertiesNetInterface.h:126
Class Description: DtSimObjectNetInterface.
Definition: simObjectNetInterface.h:37
Defines the DtPropertyInterface class, the interface for all property classes.
virtual void updateUuid()
Definition: localExtendedPropertiesNetInterface.h:136
static DtSimObjectNetInterface * creator(const DtString &name, DtVrfObject *vrfObject, DtReaderWriterRegistry *parentRegistry, bool publishObject)
Definition: localExtendedPropertiesNetInterface.h:151
DtLocalExtendedPropertiesNetInterface()
default constructor
Definition: localExtendedPropertiesNetInterface.h:40

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)