OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JsonColumnEncoding Class Reference

#include <DdlCommandExecutor.h>

+ Inheritance diagram for JsonColumnEncoding:
+ Collaboration diagram for 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 103 of file DdlCommandExecutor.h.

Constructor & Destructor Documentation

JsonColumnEncoding::JsonColumnEncoding ( const rapidjson::Value &  data_type)
inline

Definition at line 105 of file DdlCommandExecutor.h.

106  : 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 491 of file DdlCommandExecutor.cpp.

References CHECK.

491  {
492  CHECK(data_type.IsObject());
493  CHECK(data_type.HasMember("encoding"));
494  CHECK(data_type["encoding"].IsObject());
495 
496  const auto& encoding = data_type["encoding"].GetObject();
497  CHECK(encoding.HasMember("type"));
498  CHECK(encoding["type"].IsString());
499  return new std::string(encoding["type"].GetString());
500 }
#define CHECK(condition)
Definition: Logger.h:197
int JsonColumnEncoding::getEncodingParam ( const rapidjson::Value &  data_type)
staticprivate

Definition at line 502 of file DdlCommandExecutor.cpp.

References CHECK.

502  {
503  CHECK(data_type.IsObject());
504  CHECK(data_type.HasMember("encoding"));
505  CHECK(data_type["encoding"].IsObject());
506 
507  int encoding_size = 0;
508  const auto& encoding = data_type["encoding"].GetObject();
509  if (encoding.HasMember("size") && !encoding["size"].IsNull()) {
510  CHECK(encoding["size"].IsInt());
511  encoding_size = encoding["size"].GetInt();
512  }
513  return encoding_size;
514 }
#define CHECK(condition)
Definition: Logger.h:197

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