Jpp  17.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
datatypes.cpp
Go to the documentation of this file.
1 #include "datatypes.hpp"
2 
3 /**
4  * \author cpellegrino
5  */
6 
7 unsigned int const ttdc = 1414808643;
8 unsigned int const taes = 1413563731;
9 unsigned int const tmch = 1414349640;
10 unsigned int const unkn = 0;
11 
13 {
14  std::pair<int, std::string> const static unknown = std::make_pair(unkn, "unknown");
15  std::pair<int, std::string> const static acoustic = std::make_pair(taes, "acoustic data");
16  std::pair<int, std::string> const static optical = std::make_pair(ttdc, "optical data");
17  std::pair<int, std::string> const static monitoring = std::make_pair(tmch, "monitoring data");
18 
19  if (header.dataType() == tmch) {
20  return monitoring;
21  }
22 
23  if (header.dataType() == ttdc) {
24  return optical;
25  }
26 
27  if (header.dataType() == taes) {
28  return acoustic;
29  }
30 
31  return unknown;
32 }
33 
34 std::string const& getType(uint32_t datatype)
35 {
36  std::string const static unknown = "unknown";
37  std::string const static acoustic = "acoustic";
38  std::string const static optical = "optical";
39  std::string const static monitoring = "monitoring";
40 
41  if (datatype == tmch) {
42  return monitoring;
43  }
44 
45  if (datatype == ttdc) {
46  return optical;
47  }
48 
49  if (datatype == taes) {
50  return acoustic;
51  }
52 
53  return unknown;
54 }
unsigned int const tmch
Definition: datatypes.cpp:9
std::pair< int, std::string > const & getType(CLBCommonHeader const &header)
Definition: datatypes.cpp:12
then awk string
unsigned int const ttdc
Definition: datatypes.cpp:7
uint32_t dataType() const
unsigned int const taes
Definition: datatypes.cpp:8
unsigned int const unkn
Definition: datatypes.cpp:10