VR-Forces 4.7 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 
61  const DtRemoteExtendedPropertiesNetInterface & operator=(const
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 
99  virtual void updateFromReflectedObject()
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 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)