0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
Hypertable::SubProperties Class Reference

Helper class to access parts of the properties. More...

#include <Properties.h>

Collaboration diagram for Hypertable::SubProperties:
Collaboration graph
[legend]

Public Member Functions

 SubProperties (PropertiesPtr &props, const String &prefix)
 Constructor. More...
 
String full_name (const String &name) const
 Returns the full name of a sub-property. More...
 
template<typename T >
get (const String &name) const
 Calls Properties::get for a sub-property. More...
 
template<typename T >
get (const String &name, const T &default_value) const
 Calls Properties::get for a sub-property. More...
 
bool defaulted (const String &name) const
 Check whether a sub-property has a default value. More...
 
bool has (const String &name) const
 Check whether a sub-property exists. More...
 

Private Attributes

PropertiesPtr m_props
 Reference to the original Properties object. More...
 
String m_prefix
 The common prefix of all sub-properties. More...
 

Detailed Description

Helper class to access parts of the properties.

This snippet extracts all properties that start with "Hypertable.RangeServer." and uses the SubProperty to access "Hypertable.RangeServer.Range.SplitSize".

SubProperties cfg(props, "Hypertable.RangeServer.");
i64_t foo = cfg.get_i64("Range.SplitSize");

Definition at line 458 of file Properties.h.

Constructor & Destructor Documentation

Hypertable::SubProperties::SubProperties ( PropertiesPtr props,
const String prefix 
)
inline

Constructor.

Parameters
propsThe original Properties object
prefixThe common prefix of all sub-properties

Definition at line 465 of file Properties.h.

Member Function Documentation

bool Hypertable::SubProperties::defaulted ( const String name) const
inline

Check whether a sub-property has a default value.

Parameters
nameThe name of the sub-property
Returns
true if the value is default

Definition at line 505 of file Properties.h.

String Hypertable::SubProperties::full_name ( const String name) const
inline

Returns the full name of a sub-property.

Parameters
nameThe name of the sub-property
Returns
The full name (prefix + name)

Definition at line 474 of file Properties.h.

template<typename T >
T Hypertable::SubProperties::get ( const String name) const
inline

Calls Properties::get for a sub-property.

Parameters
nameThe name of the sub-property

Definition at line 484 of file Properties.h.

template<typename T >
T Hypertable::SubProperties::get ( const String name,
const T &  default_value 
) const
inline

Calls Properties::get for a sub-property.

Parameters
nameThe name of the sub-property
default_valueThe default value to return if not found

Definition at line 495 of file Properties.h.

bool Hypertable::SubProperties::has ( const String name) const
inline

Check whether a sub-property exists.

Parameters
nameThe name of the sub-property
Returns
true if the property exists

Definition at line 515 of file Properties.h.

Member Data Documentation

String Hypertable::SubProperties::m_prefix
private

The common prefix of all sub-properties.

Definition at line 526 of file Properties.h.

PropertiesPtr Hypertable::SubProperties::m_props
private

Reference to the original Properties object.

Definition at line 523 of file Properties.h.


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