VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSensorRecord.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
7 
8 #pragma once
9 
13 
14 namespace makArchives
15 {
16 
20  {
21  public:
24 
26  DtSensorRecord(const DtSensorRecord& obj);
27 
29  DtSensorRecord& operator=(const DtSensorRecord& rhs);
30 
32 
33  typedef std::map<std::string, int> AttributesInt;
34  typedef std::map<std::string, bool> AttributesBool;
35  typedef std::map<std::string, float> AttributesFloat;
36  typedef std::map<std::string, std::string> AttributesString;
38 
40  const AttributesInt& attributesInt() const;
41 
43  const AttributesFloat& attributesFloat() const;
44 
46  const AttributesBool& attributesBool() const;
47 
49  const AttributesString& attributesString() const;
50 
52  void setAttributes(const AttributesInt& attributes);
53 
55  void setAttributes(const AttributesBool& attributes);
56 
58  void setAttributes(const AttributesFloat& attributes);
59 
61  void setAttributes(const AttributesString& attributes);
62 
64  const std::string& name() const;
65 
67  void setName(const std::string& name);
68 
70  const std::string& module() const;
71 
73  void setModule(const std::string& moduleName);
74 
75  protected:
76 
78  void cleanupAttributeNames();
79 
81  void removeUnusedAttributes();
82 
83  friend class boost::serialization::access;
84 
85  template<class Archive>
86  void serialize(Archive & ar, const unsigned int version)
87  {
88  ar & BOOST_SERIALIZATION_NVP(myName);
89  ar & BOOST_SERIALIZATION_NVP(myModuleName);
90  ar & BOOST_SERIALIZATION_NVP(myAttributesInt);
91  ar & BOOST_SERIALIZATION_NVP(myAttributesBool);
92  ar & BOOST_SERIALIZATION_NVP(myAttributesFloat);
93  ar & BOOST_SERIALIZATION_NVP(myAttributesString);
94 
95  if(version <= 1)
96  {
97  cleanupAttributeNames();
98  }
99 
100  removeUnusedAttributes();
101  }
102 
109  };
110 }
112 
AttributesBool myAttributesBool
Definition: DtSensorRecord.h:108
BOOST_CLASS_VERSION(makArchives::DtDiGuySettingsRecord, 3)
AttributesInt myAttributesInt
Definition: DtSensorRecord.h:105
std::string Utf8String
Typedef&#39;d string used to indicate that a std::string must use utf8.
Definition: UnicodeStringRecord.h:11
Contains DLL export macros.
AttributesFloat myAttributesFloat
Definition: DtSensorRecord.h:106
std::map< std::string, int > AttributesInt
Definition: DtSensorRecord.h:33
Utf8String myName
Definition: DtSensorRecord.h:103
std::map< std::string, float > AttributesFloat
Definition: DtSensorRecord.h:35
AttributesString myAttributesString
Definition: DtSensorRecord.h:107
Utf8String myModuleName
Definition: DtSensorRecord.h:104
Record for a sensor definition.
Definition: DtSensorRecord.h:19
void serialize(Archive &ar, const unsigned int version)
Definition: DtSensorRecord.h:86
#define DT_DLL_MAKARCHIVES
Definition: makArchives.h:31
std::map< std::string, std::string > AttributesString
Definition: DtSensorRecord.h:36
std::map< std::string, bool > AttributesBool
Definition: DtSensorRecord.h:34

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)