Jpp
Functions | Variables
datatypes.cpp File Reference
#include "datatypes.hpp"

Go to the source code of this file.

Functions

std::pair< int, std::string > const & getType (CLBCommonHeader const &header)
 
std::string const & getType (uint32_t datatype)
 

Variables

unsigned const int ttdc = 1414808643
 
unsigned const int taes = 1413563731
 
unsigned const int tmch = 1414349640
 
unsigned const int unkn = 0
 

Function Documentation

◆ getType() [1/2]

std::pair<int, std::string> const& getType ( CLBCommonHeader const &  header)

Definition at line 12 of file datatypes.cpp.

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 }

◆ getType() [2/2]

std::string const& getType ( uint32_t  datatype)

Definition at line 34 of file datatypes.cpp.

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 }

Variable Documentation

◆ ttdc

unsigned const int ttdc = 1414808643
Author
cpellegrino

Definition at line 7 of file datatypes.cpp.

◆ taes

unsigned const int taes = 1413563731

Definition at line 8 of file datatypes.cpp.

◆ tmch

unsigned const int tmch = 1414349640

Definition at line 9 of file datatypes.cpp.

◆ unkn

unsigned const int unkn = 0

Definition at line 10 of file datatypes.cpp.

taes
unsigned const int taes
Definition: datatypes.cpp:8
std::pair
Definition: JSTDTypes.hh:15
tmch
unsigned const int tmch
Definition: datatypes.cpp:9
ttdc
unsigned const int ttdc
Definition: datatypes.cpp:7
unkn
unsigned const int unkn
Definition: datatypes.cpp:10