SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
Column.h
Go to the documentation of this file.
1 /*
2  * SWC-DB© Copyright since 2019 Alex Kashirin <kashirin.alex@gmail.com>
3  * License details at <https://github.com/kashirin-alex/swc-db/#license>
4  */
5 
6 #ifndef swcdb_db_types_Column_h
7 #define swcdb_db_types_Column_h
8 
9 #include "swcdb/core/Compat.h"
10 
11 namespace SWC { namespace DB {
12 
13 
15 namespace Types {
16 
17 
18 enum class Column : uint8_t {
19  UNKNOWN = 0x0,
20  PLAIN = 0x1,
21  COUNTER_I64 = 0x2,
22  COUNTER_I32 = 0x3,
23  COUNTER_I16 = 0x4,
24  COUNTER_I8 = 0x5,
25  SERIAL = 0x6,
26  CELL_DEFINED = 0xf
27 };
28 
29 bool SWC_CONST_FUNC is_counter(const Column typ) noexcept;
30 
31 const char* SWC_CONST_FUNC to_string(Column typ) noexcept;
32 
33 Column SWC_PURE_FUNC column_type_from(const std::string& typ) noexcept;
34 
35 
37 std::string repr_col_type(int typ) {
38  return to_string(Column(typ));
39 }
40 
42 int from_string_col_type(const std::string& typ) noexcept {
43  return int(column_type_from(typ));
44 }
45 
46 
47 }}}
48 
49 
50 #ifdef SWC_IMPL_SOURCE
51 #include "swcdb/db/Types/Column.cc"
52 #endif
53 
54 #endif // swcdb_db_types_Column_h
SWC::DB::Types::column_type_from
Column SWC_PURE_FUNC column_type_from(const std::string &typ) noexcept
Definition: Column.cc:59
Column.cc
SWC::DB::Types::repr_col_type
SWC_CAN_INLINE std::string repr_col_type(int typ)
Definition: Column.h:37
SWC::DB::Types::to_string
const char *SWC_CONST_FUNC to_string(Column typ) noexcept
Definition: Column.cc:38
SWC::DB::Types::Column
Column
Definition: Column.h:18
SWC::DB::Types::Column::UNKNOWN
@ UNKNOWN
SWC_CONST_FUNC
#define SWC_CONST_FUNC
Definition: Compat.h:107
SWC_CAN_INLINE
#define SWC_CAN_INLINE
Definition: Compat.h:102
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::DB::Types::is_counter
bool SWC_CONST_FUNC is_counter(const Column typ) noexcept
Definition: Column.cc:26
SWC_PURE_FUNC
#define SWC_PURE_FUNC
Definition: Compat.h:108
Compat.h
SWC::DB::Types::Column::SERIAL
@ SERIAL
SWC::DB::Types::from_string_col_type
SWC_CAN_INLINE int from_string_col_type(const std::string &typ) noexcept
Definition: Column.h:42