OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{DdlCommandExecutor.cpp}::JsonColumnEncoding Class Reference
+ Inheritance diagram for anonymous_namespace{DdlCommandExecutor.cpp}::JsonColumnEncoding:
+ Collaboration diagram for anonymous_namespace{DdlCommandExecutor.cpp}::JsonColumnEncoding:

Public Member Functions

 JsonColumnEncoding (const rapidjson::Value &data_type)
 
- Public Member Functions inherited from ddl_utils::Encoding
 Encoding (std::string *encoding_name, int encoding_param)
 
virtual ~Encoding ()
 
virtual const std::string * get_encoding_name () const
 
virtual int get_encoding_param () const
 

Static Private Member Functions

static std::string * getEncodingName (const rapidjson::Value &data_type)
 
static int getEncodingParam (const rapidjson::Value &data_type)
 

Additional Inherited Members

- Protected Attributes inherited from ddl_utils::Encoding
std::unique_ptr< std::string > encoding_name
 
int encoding_param
 

Detailed Description

Definition at line 425 of file DdlCommandExecutor.cpp.

Constructor & Destructor Documentation

anonymous_namespace{DdlCommandExecutor.cpp}::JsonColumnEncoding::JsonColumnEncoding ( const rapidjson::Value &  data_type)
inline

Definition at line 427 of file DdlCommandExecutor.cpp.

428  : ddl_utils::Encoding(getEncodingName(data_type), getEncodingParam(data_type)) {}
static int getEncodingParam(const rapidjson::Value &data_type)
static std::string * getEncodingName(const rapidjson::Value &data_type)

Member Function Documentation

std::string * JsonColumnEncoding::getEncodingName ( const rapidjson::Value &  data_type)
staticprivate

Definition at line 1348 of file DdlCommandExecutor.cpp.

References CHECK.

1348  {
1349  CHECK(data_type.IsObject());
1350  CHECK(data_type.HasMember("encoding"));
1351  CHECK(data_type["encoding"].IsObject());
1352 
1353  const auto& encoding = data_type["encoding"].GetObject();
1354  CHECK(encoding.HasMember("type"));
1355  CHECK(encoding["type"].IsString());
1356  return new std::string(encoding["type"].GetString());
1357 }
#define CHECK(condition)
Definition: Logger.h:291
int JsonColumnEncoding::getEncodingParam ( const rapidjson::Value &  data_type)
staticprivate

Definition at line 1359 of file DdlCommandExecutor.cpp.

References CHECK.

1359  {
1360  CHECK(data_type.IsObject());
1361  CHECK(data_type.HasMember("encoding"));
1362  CHECK(data_type["encoding"].IsObject());
1363 
1364  int encoding_size = 0;
1365  const auto& encoding = data_type["encoding"].GetObject();
1366  if (encoding.HasMember("size") && !encoding["size"].IsNull()) {
1367  CHECK(encoding["size"].IsInt());
1368  encoding_size = encoding["size"].GetInt();
1369  }
1370  return encoding_size;
1371 }
#define CHECK(condition)
Definition: Logger.h:291

The documentation for this class was generated from the following file: