Wrapper class for a table of configuration values. More...
#include <TsValue.h>
Public Types | |
typedef ValueTable | self |
Self reference type. | |
typedef ValueTableImpl | ImplType |
Implementation type. | |
Public Member Functions | |
size_t | size () const |
Table size. | |
Generation | generation () const |
Generation. | |
ValueItem const & | operator[] (ValueIndex idx) const |
Const access by index. | |
ValueItem & | operator[] (ValueIndex idx) |
Access by index. | |
self & | forceRootItem () |
Force the existence of the root item in the table. | |
Rv< ValueIndex > | make (ValueIndex parent, ValueType type, ConstBuffer const &name=NULL_BUFFER) |
Create a new item (value) with optional name The table must contain parent. | |
bool | operator! () const |
Test for not table existence. | |
operator PseudoBool::Type () const | |
Test for table existence. | |
self & | reset () |
Reset to default constructed state. | |
Buffer | alloc (size_t n) |
Allocate a local buffer. | |
Protected Types | |
typedef IntrusivePtr< ImplType > | ImplPtr |
Smart pointer to implementation instance. | |
Protected Member Functions | |
ImplType * | instance () |
Force an implementation instance and return a pointer to it. | |
Protected Attributes | |
ImplPtr | _ptr |
Implementation instance. |
Wrapper class for a table of configuration values.
Definition at line 281 of file TsValue.h.
typedef IntrusivePtr<ImplType> ts::config::detail::ValueTable::ImplPtr [protected] |
Buffer ts::config::detail::ValueTable::alloc | ( | size_t | n | ) |
Allocate a local buffer.
This buffer will persist until the implementation instance is destoyed.
Definition at line 114 of file TsValue.cc.
References ts::config::detail::ValueTableImpl::_buffers, ts::Buffer::_ptr, and instance().
Referenced by ts::config::Configuration::alloc().
detail::ValueTable & ts::config::detail::ValueTable::forceRootItem | ( | ) |
Force the existence of the root item in the table.
this
object. Definition at line 69 of file TsValue.cc.
References ts::config::detail::ValueTableImpl::_values, ts::config::GroupValue, and instance().
Referenced by ts::config::Configuration::getRoot().
Generation ts::config::detail::ValueTable::generation | ( | ) | const [inline] |
detail::ValueTable::ImplType * ts::config::detail::ValueTable::instance | ( | ) | [protected] |
Force an implementation instance and return a pointer to it.
Definition at line 63 of file TsValue.cc.
References _ptr, ts::IntrusivePtr< T >::get(), and ts::IntrusivePtr< T >::reset().
Referenced by alloc(), and forceRootItem().
Rv< detail::ValueIndex > ts::config::detail::ValueTable::make | ( | ValueIndex | parent, | |
ValueType | type, | |||
ConstBuffer const & | name = NULL_BUFFER | |||
) |
Create a new item (value) with optional name The table must contain parent.
If name is omitted, the item has an empty name.
parent | Index of parent for item. | |
type | Type of item. | |
name | Name (may be empty). |
Definition at line 77 of file TsValue.cc.
References ts::config::detail::ValueItem::_children, ts::config::detail::ValueItem::_local_index, ts::config::detail::ValueItem::_name, ts::config::detail::ValueItem::_parent, _ptr, ts::config::detail::ValueItem::_type, ts::Rv< R >::errata(), ts::config::GroupValue, ts::config::detail::IS_CONTAINER, ts::msg::log(), ts::msg::logf(), ts::config::detail::NULL_VALUE_INDEX, ts::NumericType< T, X >::raw(), ts::config::detail::Type_Property, and ts::msg::WARN.
Referenced by ts::config::Value::makeChild().
ts::config::detail::ValueTable::operator PseudoBool::Type | ( | ) | const [inline] |
Test for table existence.
true
if the implementation instance exists, false
if not. Definition at line 641 of file TsValue.h.
References _ptr, ts::config::detail::PseudoBool::FALSE, and ts::config::detail::PseudoBool::TRUE.
bool ts::config::detail::ValueTable::operator! | ( | ) | const [inline] |
detail::ValueItem & ts::config::detail::ValueTable::operator[] | ( | ValueIndex | idx | ) |
Access by index.
idx | Index of item. |
Definition at line 109 of file TsValue.cc.
ValueItem const & ts::config::detail::ValueTable::operator[] | ( | ValueIndex | idx | ) | const [inline] |
ValueTable & ts::config::detail::ValueTable::reset | ( | ) | [inline] |
size_t ts::config::detail::ValueTable::size | ( | void | ) | const [inline] |
ImplPtr ts::config::detail::ValueTable::_ptr [protected] |
Implementation instance.
Definition at line 336 of file TsValue.h.
Referenced by generation(), instance(), make(), operator PseudoBool::Type(), operator!(), operator[](), reset(), and size().