ifw-core 6.0.0
Loading...
Searching...
No Matches
defines.hpp
Go to the documentation of this file.
1
6#ifndef IFW_DIT_DID_DEFINES_HPP_
7#define IFW_DIT_DID_DEFINES_HPP_
8
9#include <string>
10
11#include <log4cplus/logger.h>
12#include <log4cplus/loggingmacros.h>
13#include <log4cplus/version.h>
14#include <log4cplus/configurator.h>
15
16#include <boost/regex.hpp>
17#include <boost/exception/diagnostic_information.hpp>
18
19#include <fmt/format.h>
20
21#include <ciiLogManager.hpp>
22
23#include <config-ng/ciiConfigApi.hpp>
24
25#include <rad/logger.hpp>
26#include <rad/exceptions.hpp>
27
28namespace ifw::core::dit::did {
29
30 log4cplus::Logger& Logger();
31
33 enum class HdrField {
34 NAME = 1,
35 SCOPE = 2,
36 DESCRIPTION = 4,
37
39 };
40
41 const std::string DID_SCHEMA_INCLUDE = "!cfg.include schema/ifw/core/dit/did/did.schema.yaml";
42
43 const std::string HDR_TAG = "header";
44
45 // Dictionary Header Fields.
46 const std::string HDR_FIELD_NAME = "name";
47 const std::string HDR_FIELD_SCOPE = "scope";
48 const std::string HDR_FIELD_DESCRIPTION = "description";
49
54
59
61 enum class DataType {
62 BOOL = 1,
63 DOUBLE = 2,
64 INTEGER = 4,
65 STRING = 8,
66
67 ALL = (BOOL | DOUBLE | INTEGER | STRING)
68 };
69
70 // CII Cfg textual names for the record data types.
71 const std::string REC_TYPE_BOOL = "DidBoolKey";
72 const std::string REC_TYPE_DOUBLE = "DidDblKey";
73 const std::string REC_TYPE_INTEGER = "DidIntKey";
74 const std::string REC_TYPE_STRING = "DidStrKey";
75
77 DataType DataTypeToNum(const std::string& type);
78
80 std::string DataTypeToStr(const DataType type);
81
83 enum class RecField {
84 FORMAT = 1,
85 UNIT = 2,
86 COMMENT = 4,
87 DESCRIPTION = 8,
88 TYPE = 128,
89
91 };
92
93 // Dictionary Record Fields.
94 const std::string REC_FIELD_FORMAT = "format";
95 const std::string REC_FIELD_UNIT = "unit";
96 const std::string REC_FIELD_COMMENT = "comment";
97 const std::string REC_FIELD_DESCRIPTION = "description";
98 const std::string REC_FIELD_TYPE = "type";
99
101 std::string RecFieldToStr(const RecField field);
102
104 RecField RecFieldToNum(const std::string& field);
105
106} // namespace ifw::core::dit::did
107
108#endif // !IFW_DIT_DID_DEFINES_HPP_
Definition defines.cpp:12
const std::string REC_TYPE_STRING
Definition defines.hpp:74
const std::map< std::string, HdrField > HDR_FIELDS_NAME_MAP
Definition defines.hpp:55
const std::string REC_TYPE_BOOL
Definition defines.hpp:71
RecField RecFieldToNum(const std::string &field)
Map record field from string to numeric representation.
Definition defines.cpp:77
std::string DataTypeToStr(const DataType type)
Map type from numeric to string representation.
Definition defines.cpp:40
const std::map< HdrField, std::string > HDR_FIELDS_NB_MAP
Definition defines.hpp:50
const std::string REC_FIELD_UNIT
Definition defines.hpp:95
const std::string REC_TYPE_INTEGER
Definition defines.hpp:73
const std::string HDR_FIELD_SCOPE
Definition defines.hpp:47
HdrField
Dictionary header field types.
Definition defines.hpp:33
const std::string DID_SCHEMA_INCLUDE
Definition defines.hpp:41
const std::string REC_FIELD_TYPE
Definition defines.hpp:98
const std::string HDR_TAG
Definition defines.hpp:43
const std::string REC_FIELD_COMMENT
Definition defines.hpp:96
const std::string REC_FIELD_FORMAT
Definition defines.hpp:94
const std::string REC_FIELD_DESCRIPTION
Definition defines.hpp:97
log4cplus::Logger & Logger()
Definition defines.cpp:14
std::string RecFieldToStr(const RecField field)
Map record field from numeric to string representation.
Definition defines.cpp:59
RecField
Dictionary keyword record field types.
Definition defines.hpp:83
DataType DataTypeToNum(const std::string &type)
Map type from string to numeric representation.
Definition defines.cpp:24
const std::string HDR_FIELD_DESCRIPTION
Definition defines.hpp:48
const std::string REC_TYPE_DOUBLE
Definition defines.hpp:72
@ ALL
Definition did.hpp:23
const std::string HDR_FIELD_NAME
Definition defines.hpp:46
DataType
Dictionary data types.
Definition defines.hpp:61