Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

ts::config::detail::ValueTable Class Reference

Wrapper class for a table of configuration values. More...

#include <TsValue.h>

Collaboration diagram for ts::config::detail::ValueTable:
Collaboration graph
[legend]

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.
ValueItemoperator[] (ValueIndex idx)
 Access by index.
selfforceRootItem ()
 Force the existence of the root item in the table.
Rv< ValueIndexmake (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.
selfreset ()
 Reset to default constructed state.
Buffer alloc (size_t n)
 Allocate a local buffer.

Protected Types

typedef IntrusivePtr< ImplTypeImplPtr
 Smart pointer to implementation instance.

Protected Member Functions

ImplTypeinstance ()
 Force an implementation instance and return a pointer to it.

Protected Attributes

ImplPtr _ptr
 Implementation instance.

Detailed Description

Wrapper class for a table of configuration values.

Definition at line 281 of file TsValue.h.


Member Typedef Documentation

Smart pointer to implementation instance.

Definition at line 335 of file TsValue.h.

Implementation type.

Definition at line 284 of file TsValue.h.

Self reference type.

Definition at line 283 of file TsValue.h.


Member Function Documentation

Buffer ts::config::detail::ValueTable::alloc ( size_t  n  ) 

Allocate a local buffer.

This buffer will persist until the implementation instance is destoyed.

Returns:
The allocated buffer.

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.

Returns:
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]

Generation.

Returns:
The generation number.

Definition at line 643 of file TsValue.h.

References _ptr.

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.

Returns:
Index of the new value item.
Parameters:
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.

Returns:
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]

Test for not table existence.

Returns:
false if the implementation instance exists, true if not.

Definition at line 640 of file TsValue.h.

References _ptr.

detail::ValueItem & ts::config::detail::ValueTable::operator[] ( ValueIndex  idx  ) 

Access by index.

Returns:
The value item at index idx.
Parameters:
idx Index of item.

Definition at line 109 of file TsValue.cc.

References _ptr, and assert.

ValueItem const & ts::config::detail::ValueTable::operator[] ( ValueIndex  idx  )  const [inline]

Const access by index.

Returns:
The value item at index idx.
Parameters:
idx Index of item.

Definition at line 644 of file TsValue.h.

ValueTable & ts::config::detail::ValueTable::reset (  )  [inline]

Reset to default constructed state.

Returns:
this object.

Definition at line 645 of file TsValue.h.

References _ptr.

size_t ts::config::detail::ValueTable::size ( void   )  const [inline]

Table size.

Returns:
The number of value items in the table.

Definition at line 642 of file TsValue.h.

References _ptr.


Field Documentation

Implementation instance.

Definition at line 336 of file TsValue.h.

Referenced by generation(), instance(), make(), operator PseudoBool::Type(), operator!(), operator[](), reset(), and size().


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