VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
genericAttributeStateRepositoryHLA.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 
11 #ifdef DtHLA
12 
13 #include <vl/stateRepository.h>
14 #include <map>
15 
16 namespace makVrfVrlinkExtToolkit
17 {
19  {
20  public:
21 
24  : handle(other.handle)
25  , name(other.name)
26  , buffer(other.buffer)
27  , wasUpdated(other.wasUpdated){}
28 
30 
31  RTI::AttributeHandle handle;
33  std::vector<char> buffer;
34  bool wasUpdated;
35  };
36 
40  template <class BaseSR>
42  {
43  public:
46 
49 
52 
55 
57  virtual DtStateRepository* clone(bool copy) const;
58 
61 
63  virtual void printData() const;
64 
66  virtual void printDataToStream(std::ostream& stream) const;
67 
69  virtual bool publishesAttribute(const DtString& val) const;
70 
72  virtual void setAttributeByHandle(const RTI::AttributeHandle& attrHdl, const char* attrValue, unsigned size);
73 
75  virtual const char* getAttributeByHandle(const RTI::AttributeHandle& attrHdl, unsigned& size) const;
76 
79  virtual const char* getAttributeByHandleIfUpdated(const RTI::AttributeHandle& attrHdl, unsigned& size) const;
80 
82  virtual void setAttributeByName(const DtString& attrName, const char* attrValue, unsigned size);
83 
85  virtual const char* getAttributeByName(const DtString& attrName, unsigned& size) const;
86 
89  virtual const char* getAttributeByNameIfUpdated(const DtString& attrName, unsigned& size) const;
90 
94  static void setAttributeNameToHandleMap(const std::map<DtString, RTI::AttributeHandle>& attrNameToHdl);
95 
96  protected:
97 
99  DtGenericAttributeInfo* cacheNameAttributeMapping(const RTI::AttributeHandle& attrHdl, const DtString& attrName) const;
100 
101  protected:
102 
105  static std::map<DtString, RTI::AttributeHandle> theAttributeHandlesByName;
106 
108  std::map<RTI::AttributeHandle, DtGenericAttributeInfo*> myAttributesByHandle;
109 
114  mutable std::map<DtString, DtGenericAttributeInfo*> myAttributesByName;
115 
116  };
117 }
118 
119 #define hGenericAttrSR_inl
120 #include "genericAttributeStateRepositoryHLA.inl"
121 #undef hGenericAttrSR_inl
122 
123 #endif

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)