VR-Forces 4.6 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"
19 #include <vrfutil/readerWriter.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 
42 
45  DtVrfObject * simObject,
46  DtReaderWriterRegistry * parentRegistry = 0,
47  bool publishObject = true)
48  : BaseNetInterface(name, simObject, parentRegistry, publishObject)
49  , myIsUninitialized(true)
50  {
51  }
52 
56  DtReaderWriterRegistry * parentRegistry = 0)
57  : BaseNetInterface(orig, parentRegistry)
58  , myIsUninitialized(true)
59  {
60  }
61 
63  const DtRemoteExtendedPropertiesNetInterface & operator=(const
65  {
66  return static_cast<const DtRemoteExtendedPropertiesNetInterface &>(
67  BaseNetInterface::operator=(orig));
68  }
69 
72 
74  virtual bool initExtendedProperties()
75  {
76  bool result = true;
77 
79  dynamic_cast<DtExtendedPropertiesStateRepository*>(this->myNetworkState);
80 
81 #if DtHLA
82  if (netWithProps)
83  {
84  netWithProps->setObjectClassHandle(this->objectClassHandle());
85  }
86 #endif
87 
88  initializeNetWithProperties();
89 
90  myIsUninitialized = false;
91 
92  return result;
93  }
94 
96  virtual void initializeNetWithProperties() = 0;
97 
101  virtual void updateFromReflectedObject()
102  {
103  if (myIsUninitialized)
104  {
105  initExtendedProperties();
106  }
107 
108  BaseNetInterface::updateFromReflectedObject();
109  }
110 
111  static DtSimObjectNetInterface * creator(const DtString & name,
112  DtVrfObject * simObject,
113  DtReaderWriterRegistry * parentRegistry,
114  bool publishObject)
115  {
116  return new
118  name, simObject, parentRegistry, publishObject);
119  }
120 
122  std::map<DtString, DtReaderWriterRegistryData *> myStatePropertyMap;
123  std::map<DtString, DtReaderWriterRegistryData *> myParamPropertyMap;
124 };
125 
126 
127 

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)