0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Enumerations | Functions
Hypertable::SystemVariable Namespace Reference

Classes

struct  Spec
 Holds a variable code and boolean value. More...
 

Enumerations

enum  Code { READONLY = 0, COUNT = 1 }
 Enumeration for variable codes. More...
 

Functions

const char * code_to_string (int var_code)
 Converts variable code to variable string. More...
 
int string_to_code (const std::string &var_string)
 Converts variable string to variable code. More...
 
bool default_value (int var_code)
 Returns default value for given variable. More...
 
std::string specs_to_string (const std::vector< Spec > &specs)
 Returns a textual representation of variable specifications. More...
 
size_t encoded_length_specs (const std::vector< Spec > &specs)
 Returns encoded length of variable specs vector. More...
 
void encode_specs (const std::vector< Spec > &specs, uint8_t **bufp)
 Encodes a vector of variable specs. More...
 
void decode_specs (std::vector< Spec > &specs, const uint8_t **bufp, size_t *remainp)
 Decodes a vector of variable specs. More...
 

Function Documentation

const char * Hypertable::SystemVariable::code_to_string ( int  var_code)

Converts variable code to variable string.

Parameters
var_codeThe variable code
Returns
Variable string corresponding to variable code

Definition at line 92 of file SystemVariable.cc.

void Hypertable::SystemVariable::decode_specs ( std::vector< Spec > &  specs,
const uint8_t **  bufp,
size_t *  remainp 
)

Decodes a vector of variable specs.

See encode_state() for format description.

Parameters
specsVector of variable specs
bufpAddress of destination buffer pointer (advanced by call)
remainpAddress of integer holding amount of remaining buffer

Definition at line 175 of file SystemVariable.cc.

bool Hypertable::SystemVariable::default_value ( int  var_code)

Returns default value for given variable.

Parameters
var_codeThe variable code
Returns
Default value for var_code

Definition at line 104 of file SystemVariable.cc.

void Hypertable::SystemVariable::encode_specs ( const std::vector< Spec > &  specs,
uint8_t **  bufp 
)

Encodes a vector of variable specs.

This method encodes a vector of variable specs formatted as follows:

  Number of variable specs
  foreach variable spec {
    variable code
    variable value
  }
Parameters
specsVector of variable specs
bufpAddress of destination buffer pointer (advanced by call)

Definition at line 167 of file SystemVariable.cc.

size_t Hypertable::SystemVariable::encoded_length_specs ( const std::vector< Spec > &  specs)

Returns encoded length of variable specs vector.

Parameters
specsVector of variable specs
Returns
Encoded length of specs

Definition at line 163 of file SystemVariable.cc.

String Hypertable::SystemVariable::specs_to_string ( const std::vector< Spec > &  specs)

Returns a textual representation of variable specifications.

Parameters
specsVector of variable specifications
Returns
Textual representation of variable specifications

Definition at line 109 of file SystemVariable.cc.

int Hypertable::SystemVariable::string_to_code ( const std::string &  var_string)

Converts variable string to variable code.

Parameters
var_stringstd::string representation of variable
Returns
Variable string corresponding to variable code or 0 if var_string is invalid

Definition at line 98 of file SystemVariable.cc.