Zero  0.1.0
Public Member Functions | Private Attributes | List of all members
sm_options Class Reference

Start-up parameters for the storage engine. See OPTIONS. More...

#include <sm_options.h>

Public Member Functions

 sm_options ()
 
 sm_options (const sm_options &other)
 
int64_t get_int_option (const std::string &option_name, int64_t default_value) const
 
bool get_bool_option (const std::string &option_name, bool default_value) const
 
const std::string & get_string_option (const std::string &option_name, const std::string &default_value) const
 
void set_int_option (const std::string &option_name, int64_t value)
 
void set_bool_option (const std::string &option_name, bool value)
 
void set_string_option (const std::string &option_name, const std::string &value)
 

Private Attributes

std::map< std::string, int64_t > _int_options
 
std::map< std::string, bool > _bool_options
 
std::map< std::string, std::string > _string_options
 

Detailed Description

Start-up parameters for the storage engine. See OPTIONS.

This class represents the entire set of parameters our storage engine needs while start-up. It consists of integer parameters, such as buffer pool size, boolean parameters and string parameters, such as log drive path. They are exposed simply as a map of parameter name and the value. NOTE This class is header-only. No need to link to anything.

Constructor & Destructor Documentation

§ sm_options() [1/2]

sm_options::sm_options ( )
inline

empty constructor.

§ sm_options() [2/2]

sm_options::sm_options ( const sm_options other)
inline

copy constructor.

Member Function Documentation

§ get_bool_option()

bool sm_options::get_bool_option ( const std::string &  option_name,
bool  default_value 
) const
inline

Returns the value of the specified boolean start up parameter.

Parameters
[in]option_namename of the parameter
[in]default_valuevalue to return if the parameter does not exist.
Returns
the value of the specified boolean start up parameter, or the default value if it doesn't exist.

§ get_int_option()

int64_t sm_options::get_int_option ( const std::string &  option_name,
int64_t  default_value 
) const
inline

Returns the value of the specified integer start up parameter.

Parameters
[in]option_namename of the parameter
[in]default_valuevalue to return if the parameter does not exist.
Returns
the value of the specified integer start up parameter, or the default value if it doesn't exist.

§ get_string_option()

const std::string & sm_options::get_string_option ( const std::string &  option_name,
const std::string &  default_value 
) const
inline

Returns the value of the specified string start up option.

Parameters
[in]option_namename of the option
[in]default_valuevalue to return if the option does not exist.
Returns
the value of the specified string start up option, or the default value if it doesn't exist.

§ set_bool_option()

void sm_options::set_bool_option ( const std::string &  option_name,
bool  value 
)
inline

Sets the value of the specified boolean start up option.

Parameters
[in]option_namename of the option
[in]valuevalue of the option.

§ set_int_option()

void sm_options::set_int_option ( const std::string &  option_name,
int64_t  value 
)
inline

Sets the value of the specified integer start up option.

Parameters
[in]option_namename of the option
[in]valuevalue of the option.

§ set_string_option()

void sm_options::set_string_option ( const std::string &  option_name,
const std::string &  value 
)
inline

Sets the value of the specified string start up option.

Parameters
[in]option_namename of the option
[in]valuevalue of the option.

Member Data Documentation

§ _bool_options

std::map<std::string, bool> sm_options::_bool_options
private

All boolean options, key=option name.

§ _int_options

std::map<std::string, int64_t> sm_options::_int_options
private

All integer options, key=option name.

§ _string_options

std::map<std::string, std::string> sm_options::_string_options
private

All string options, key=option name.


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