VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
remoteExtendedPropertiesNetInterface.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"
21 #include <vl/reflectedObject.h>
22 
23 #ifdef DtHLA
25 #else
27 #endif
28 
31 template <typename BaseNetInterface, typename BaseStateRepository>
33 {
34 protected:
35 
38 
39 public:
40 
43  DtVrfObject * simObject,
44  DtReaderWriterRegistry * parentRegistry = 0,
45  bool publishObject = true)
46  : BaseNetInterface(name, simObject, parentRegistry, publishObject)
47  , myIsUninitialized(true)
48  {
49  }
50 
54  DtReaderWriterRegistry * parentRegistry = 0)
55  : BaseNetInterface(orig, parentRegistry)
56  , myIsUninitialized(true)
57  {
58  }
59 
63  {
64  return static_cast<const DtRemoteExtendedPropertiesNetInterface &>(
65  BaseNetInterface::operator=(orig));
66  }
67 
70 
72  virtual bool initExtendedProperties()
73  {
74  bool result = true;
75 
76  BaseStateRepository* stateRep =
77  dynamic_cast<BaseStateRepository*>(this->myNetworkState);
78 
79 #if DtHLA
80  if (stateRep)
81  {
82  stateRep->setObjectClassHandle(this->objectClassHandle());
83  }
84 #endif
85 
86  initializeNetWithProperties();
87 
88  myIsUninitialized = false;
89 
90  return result;
91  }
92 
94  virtual void initializeNetWithProperties() = 0;
95 
100  {
101  if (myIsUninitialized)
102  {
103  initExtendedProperties();
104  }
105 
106  BaseNetInterface::updateFromReflectedObject();
107  }
108 
109  static DtSimObjectNetInterface * creator(const DtString & name,
110  DtVrfObject * simObject,
111  DtReaderWriterRegistry * parentRegistry,
112  bool publishObject)
113  {
114  return new
116  name, simObject, parentRegistry, publishObject);
117  }
118 
120  std::map<DtString, DtReaderWriterRegistryData *> myStatePropertyMap;
121  std::map<DtString, DtReaderWriterRegistryData *> myParamPropertyMap;
122 };
123 
124 
125 
DtRemoteExtendedPropertiesNetInterface(const DtString &name, DtVrfObject *simObject, DtReaderWriterRegistry *parentRegistry=0, bool publishObject=true)
read/writable constructor
Definition: remoteExtendedPropertiesNetInterface.h:42
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
std::map< DtString, DtReaderWriterRegistryData * > myStatePropertyMap
Definition: remoteExtendedPropertiesNetInterface.h:120
virtual bool initExtendedProperties()
Initializer.
Definition: remoteExtendedPropertiesNetInterface.h:72
bool myIsUninitialized
Definition: remoteExtendedPropertiesNetInterface.h:119
Definition: readerWriterRegistry.h:39
Contains the DtSensorFieldOfViewPublisher class declaration.
virtual void updateFromReflectedObject()
Calls the base class function to copy the network data to the local state repository, then does the same for the extended property attributes.
Definition: remoteExtendedPropertiesNetInterface.h:99
const DtRemoteExtendedPropertiesNetInterface & operator=(const DtRemoteExtendedPropertiesNetInterface< BaseNetInterface, BaseStateRepository > &orig)
assignment operator
Definition: remoteExtendedPropertiesNetInterface.h:61
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
static DtSimObjectNetInterface * creator(const DtString &name, DtVrfObject *simObject, DtReaderWriterRegistry *parentRegistry, bool publishObject)
Definition: remoteExtendedPropertiesNetInterface.h:109
virtual ~DtRemoteExtendedPropertiesNetInterface()
destructor
Definition: remoteExtendedPropertiesNetInterface.h:69
Implements the DtRemoteExtendedPropertiesNetInterface class template.
Definition: remoteExtendedPropertiesNetInterface.h:32
Class Description: DtSimObjectNetInterface.
Definition: simObjectNetInterface.h:37
DtRemoteExtendedPropertiesNetInterface()
default constructor
Definition: remoteExtendedPropertiesNetInterface.h:37
DtRemoteExtendedPropertiesNetInterface(const DtRemoteExtendedPropertiesNetInterface< BaseNetInterface, BaseStateRepository > &orig, DtReaderWriterRegistry *parentRegistry=0)
copy constructor
Definition: remoteExtendedPropertiesNetInterface.h:52
std::map< DtString, DtReaderWriterRegistryData * > myParamPropertyMap
Definition: remoteExtendedPropertiesNetInterface.h:121

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)