UniRec 3.3.2
Loading...
Searching...
No Matches
unirecTypes.hpp
Go to the documentation of this file.
1
10#pragma once
11
12#include "ipAddress.hpp"
13#include "macAddress.hpp"
14#include "urTime.hpp"
15
16#include <cstddef>
17#include <string>
18#include <string_view>
19#include <unirec/unirec.h>
20
21namespace Nemea {
22
29template<typename T>
31
32template<>
34{
35 return UR_TYPE_BYTES;
36}
37
38template<>
40{
41 return UR_TYPE_CHAR;
42}
43
44template<>
46{
47 return UR_TYPE_STRING;
48}
49
50template<>
52{
53 return UR_TYPE_STRING;
54}
55
56template<>
58{
59 return UR_TYPE_STRING;
60}
61
62template<>
64{
65 return UR_TYPE_UINT8;
66}
67
68template<>
70{
71 return UR_TYPE_A_UINT8;
72}
73
74template<>
76{
77 return UR_TYPE_INT8;
78}
79
80template<>
82{
83 return UR_TYPE_A_INT8;
84}
85
86template<>
88{
89 return UR_TYPE_UINT16;
90}
91
92template<>
94{
95 return UR_TYPE_A_UINT16;
96}
97
98template<>
100{
101 return UR_TYPE_INT16;
102}
103
104template<>
106{
107 return UR_TYPE_A_INT16;
108}
109
110template<>
112{
113 return UR_TYPE_UINT32;
114}
115
116template<>
118{
119 return UR_TYPE_A_UINT32;
120}
121
122template<>
124{
125 return UR_TYPE_INT32;
126}
127
128template<>
130{
131 return UR_TYPE_A_INT32;
132}
133
134template<>
136{
137 return UR_TYPE_UINT64;
138}
139
140template<>
142{
143 return UR_TYPE_A_UINT64;
144}
145
146template<>
148{
149 return UR_TYPE_INT64;
150}
151
152template<>
154{
155 return UR_TYPE_A_INT64;
156}
157
158template<>
160{
161 return UR_TYPE_FLOAT;
162}
163
164template<>
166{
167 return UR_TYPE_A_FLOAT;
168}
169
170template<>
172{
173 return UR_TYPE_DOUBLE;
174}
175
176template<>
178{
179 return UR_TYPE_A_DOUBLE;
180}
181
182template<>
184{
185 return UR_TYPE_MAC;
186}
187
188template<>
190{
191 return UR_TYPE_A_MAC;
192}
193
194template<>
196{
197 return UR_TYPE_IP;
198}
199
200template<>
202{
203 return UR_TYPE_A_IP;
204}
205
206template<>
208{
209 return UR_TYPE_TIME;
210}
211
212template<>
214{
215 return UR_TYPE_A_TIME;
216}
217
218} // namespace Nemea
Header file containing the definition of the IpAddress class.
constexpr ur_field_type_t getExpectedUnirecType< int64_t >()
constexpr ur_field_type_t getExpectedUnirecType< double * >()
constexpr ur_field_type_t getExpectedUnirecType< IpAddress * >()
constexpr ur_field_type_t getExpectedUnirecType< int8_t >()
constexpr ur_field_type_t getExpectedUnirecType< float * >()
constexpr ur_field_type_t getExpectedUnirecType< uint16_t >()
constexpr ur_field_type_t getExpectedUnirecType< float >()
constexpr ur_field_type_t getExpectedUnirecType< std::byte * >()
constexpr ur_field_type_t getExpectedUnirecType< IpAddress >()
constexpr ur_field_type_t getExpectedUnirecType< uint8_t * >()
constexpr ur_field_type_t getExpectedUnirecType< int64_t * >()
constexpr ur_field_type_t getExpectedUnirecType< std::string >()
constexpr ur_field_type_t getExpectedUnirecType< uint16_t * >()
constexpr ur_field_type_t getExpectedUnirecType< uint32_t * >()
constexpr ur_field_type_t getExpectedUnirecType< uint8_t >()
constexpr ur_field_type_t getExpectedUnirecType< std::string_view >()
constexpr ur_field_type_t getExpectedUnirecType< int32_t * >()
constexpr ur_field_type_t getExpectedUnirecType< UrTime >()
constexpr ur_field_type_t getExpectedUnirecType< int8_t * >()
constexpr ur_field_type_t getExpectedUnirecType< uint64_t >()
constexpr ur_field_type_t getExpectedUnirecType< uint32_t >()
constexpr ur_field_type_t getExpectedUnirecType< int16_t >()
constexpr ur_field_type_t getExpectedUnirecType< int16_t * >()
constexpr ur_field_type_t getExpectedUnirecType< MacAddress * >()
constexpr ur_field_type_t getExpectedUnirecType()
Determines the expected UniRec field type for a given C++ type T.
constexpr ur_field_type_t getExpectedUnirecType< MacAddress >()
constexpr ur_field_type_t getExpectedUnirecType< char >()
constexpr ur_field_type_t getExpectedUnirecType< int32_t >()
constexpr ur_field_type_t getExpectedUnirecType< uint64_t * >()
constexpr ur_field_type_t getExpectedUnirecType< char * >()
constexpr ur_field_type_t getExpectedUnirecType< UrTime * >()
constexpr ur_field_type_t getExpectedUnirecType< double >()
Definition of UniRec structures and functions.
ur_field_type_t
Definition unirec.h:95
@ UR_TYPE_A_UINT32
unsigned int (32b) array
Definition unirec.h:118
@ UR_TYPE_UINT64
unsigned int (64b)
Definition unirec.h:105
@ UR_TYPE_A_UINT16
unsigned int (16b) array
Definition unirec.h:116
@ UR_TYPE_A_INT64
int (64b) array
Definition unirec.h:121
@ UR_TYPE_A_DOUBLE
double (64b) array
Definition unirec.h:123
@ UR_TYPE_A_IP
IP address (128b) array.
Definition unirec.h:124
@ UR_TYPE_INT16
int (8b)
Definition unirec.h:102
@ UR_TYPE_A_INT32
int (32b) array
Definition unirec.h:119
@ UR_TYPE_A_INT8
int (8b) array
Definition unirec.h:115
@ UR_TYPE_A_INT16
int (8b) array
Definition unirec.h:117
@ UR_TYPE_IP
IP address (128b)
Definition unirec.h:109
@ UR_TYPE_INT8
int (8b)
Definition unirec.h:100
@ UR_TYPE_CHAR
char
Definition unirec.h:98
@ UR_TYPE_A_UINT8
unsigned int (8b) array
Definition unirec.h:114
@ UR_TYPE_DOUBLE
double (64b)
Definition unirec.h:108
@ UR_TYPE_A_FLOAT
float (32b) array
Definition unirec.h:122
@ UR_TYPE_A_UINT64
unsigned int (64b) array
Definition unirec.h:120
@ UR_TYPE_A_MAC
MAC address (48b) array.
Definition unirec.h:125
@ UR_TYPE_TIME
time (64b)
Definition unirec.h:111
@ UR_TYPE_UINT8
unsigned int (8b)
Definition unirec.h:99
@ UR_TYPE_INT64
int (64b)
Definition unirec.h:106
@ UR_TYPE_STRING
var-len fields (string where only printable characters are expected; '\0' at the end should NOT be in...
Definition unirec.h:96
@ UR_TYPE_A_TIME
time (64b) array
Definition unirec.h:126
@ UR_TYPE_INT32
int (32b)
Definition unirec.h:104
@ UR_TYPE_UINT16
unsigned int (16b)
Definition unirec.h:101
@ UR_TYPE_UINT32
unsigned int (32b)
Definition unirec.h:103
@ UR_TYPE_MAC
MAC address (48b)
Definition unirec.h:110
@ UR_TYPE_BYTES
var-len fields (generic string of bytes)
Definition unirec.h:97
@ UR_TYPE_FLOAT
float (32b)
Definition unirec.h:107