Measurement.hpp
Go to the documentation of this file.
1 //
2 // Measurement.hpp
3 //
4 // Defines a very basic measurement structure
5 // Copyright (c) Sick AG
6 // created: 31.05.2010
7 //
8 // HISTORY
9 //
10 // 1.0.0 31.05.2010, VWi
11 // Initial version.
12 
13 
14 #ifndef MEASUREMENT_HPP
15 #define MEASUREMENT_HPP
16 
17 #include <string> // for std::string
18 #include <vector> // for std::vector
19 #include "../BasicDatatypes.hpp"
20 
21 //
22 // Advanced types
23 //
25 {
26  Meastype_Unknown = 0x0000,
27 
33 
40 };
41 
42 namespace datatypes
43 {
44 
46 {
47 public:
49  virtual ~Measurement() {};
50 
51  // Estimate the memory usage of this object
52  inline virtual const UINT32 getUsedMemory() const {return ((sizeof(*this)) + m_textValue.length());};
53 
54  std::string getName() const; // Returns the type as a readable string
55  std::string valueToString() const; // Returns the value as a readable string
56 
58 
59 
60 
61  double m_doubleValue;
63  std::string m_textValue;
64 };
65 
66 
67 // -----------------------------------------------
68 
69 
70 class MeasurementList : public BasicData
71 {
72 public:
73 // MeasurementList(): m_datatype(Datatype_MeasurementList) {} // {m_datatype = Datatype_MeasurementList;};
75  virtual ~MeasurementList() {};
76 
77  // Estimate the memory usage of this object
78  inline virtual const UINT32 getUsedMemory() const
79  {
80  UINT32 sum = sizeof(*this);
81  std::vector<Measurement>::const_iterator iter;
82  for (iter = m_list.begin(); iter != m_list.end(); iter++)
83  {
84  sum += iter->getUsedMemory();
85  }
86  return sum;
87  }
88 
89  std::vector<Measurement> m_list;
90 };
91 
92 } // namespace datatypes
93 
94 #endif // MEASUREMENT_HPP
std::string valueToString() const
Definition: Measurement.cpp:66
virtual const UINT32 getUsedMemory() const
Definition: Measurement.hpp:78
uint32_t UINT32
MeasurementType
Definition: Measurement.hpp:24
std::vector< Measurement > m_list
Definition: Measurement.hpp:89
MeasurementType m_measType
Definition: Measurement.hpp:57
int32_t INT32
std::string getName() const
Definition: Measurement.cpp:26
virtual const UINT32 getUsedMemory() const
Definition: Measurement.hpp:52


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Mon Oct 26 2020 03:27:30