Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# Oscl_TagTree< T, Alloc > Class Template Reference
[OSCL Base]

`#include <oscl_tagtree.h>`

## Public Types
typedef Oscl_Tag< Alloc > | tag_type
typedef tag_type::tag_base_type | tag_base_type
typedef Oscl_Vector< Node *, Alloc > | children_type
typedef Node | node_type
typedef node_type * | node_ptr
typedef Oscl_Map< const tag_base_type, node_ptr, Alloc, Oscl_Tag_Base > | map_type
typedef map_type::size_type | size_type
typedef map_type::value_type | value_type
typedef Oscl_Pair< iterator, bool > | pair_iterator_bool
## Public Methods
| Oscl_TagTree (size_type max_depth=0)
| Oscl_TagTree (const Oscl_TagTree< T, Alloc > &x)
Oscl_TagTree< T, Alloc > & | operator= (const Oscl_TagTree< T, Alloc > &x)
| ~Oscl_TagTree ()
iterator | begin ()
const_iterator | begin () const
iterator | end ()
const_iterator | end () const
bool | empty () const
size_type | size () const
T & | operator[] (const tag_base_type &t)
pair_iterator_bool | insert (const tag_base_type &t, const T &x)
void | erase (iterator position)
size_type | erase (const tag_base_type &x)
void | clear ()
iterator | find (const tag_base_type &x)
size_type | count (const tag_base_type &x) const

## Detailed Description

### template<class T, class Alloc>
class Oscl_TagTree< T, Alloc >

Oscl_TagTree Class.

## Member Typedef Documentation

template<class T, class Alloc>
typedef Oscl_Vector<Node*, Alloc> Oscl_TagTree< T, Alloc >::children_type

template<class T, class Alloc>
typedef Oscl_Map<const tag_base_type, node_ptr, Alloc , Oscl_Tag_Base> Oscl_TagTree< T, Alloc >::map_type

template<class T, class Alloc>
typedef node_type* Oscl_TagTree< T, Alloc >::node_ptr

template<class T, class Alloc>
typedef Node Oscl_TagTree< T, Alloc >::node_type

template<class T, class Alloc>
typedef Oscl_Pair<iterator, bool> Oscl_TagTree< T, Alloc >::pair_iterator_bool

template<class T, class Alloc>
typedef map_type::size_type Oscl_TagTree< T, Alloc >::size_type

template<class T, class Alloc>
typedef tag_type::tag_base_type Oscl_TagTree< T, Alloc >::tag_base_type

template<class T, class Alloc>
typedef Oscl_Tag<Alloc> Oscl_TagTree< T, Alloc >::tag_type

template<class T, class Alloc>
typedef map_type::value_type Oscl_TagTree< T, Alloc >::value_type

## Constructor & Destructor Documentation

template<class T, class Alloc>
Oscl_TagTree< T, Alloc >::Oscl_TagTree | ( | size_type | max_depth = 0 | ) | `[inline]`

| Creates a tag tree with only a root node with tag ""

template<class T, class Alloc>
Oscl_TagTree< T, Alloc >::Oscl_TagTree | ( | const Oscl_TagTree< T, Alloc > & | x | ) | `[inline]`

| Copy constructor

template<class T, class Alloc>
Oscl_TagTree< T, Alloc >::~Oscl_TagTree | ( |  | ) | `[inline]`

| Destructor

## Member Function Documentation

template<class T, class Alloc>
const_iterator Oscl_TagTree< T, Alloc >::begin | ( |  | ) | const`[inline]`

| Returns an iterator pointing to the first node in the tree.

template<class T, class Alloc>
iterator Oscl_TagTree< T, Alloc >::begin | ( |  | ) | `[inline]`

| Returns an iterator pointing to the first node in the tree.

template<class T, class Alloc>
void Oscl_TagTree< T, Alloc >::clear | ( |  | ) | `[inline]`

| Erases the entire tag tree.

template<class T, class Alloc>
size_type Oscl_TagTree< T, Alloc >::count | ( | const tag_base_type & | x | ) | const`[inline]`

| Returns the number of elements with key x. This can only be 0 or 1..

template<class T, class Alloc>
bool Oscl_TagTree< T, Alloc >::empty | ( |  | ) | const`[inline]`

| Returns true if tree size is 0

template<class T, class Alloc>
const_iterator Oscl_TagTree< T, Alloc >::end | ( |  | ) | const`[inline]`

| Returns a const iterator pointing to the end of the tree.

template<class T, class Alloc>
iterator Oscl_TagTree< T, Alloc >::end | ( |  | ) | `[inline]`

| Returns an iterator pointing to the end of the tree.

template<class T, class Alloc>
size_type Oscl_TagTree< T, Alloc >::erase | ( | const tag_base_type & | x | ) | `[inline]`

  | Erases the node with tag x. If the node has children, then the node will not be erased from the tree. It will be replaced with the default node value Parameters:
  x | Tag of node to erase
Returns: Returns the number of nodes erased. Since one-to-one mapping between nodes and tags, this will be either 0 or 1

template<class T, class Alloc>
void Oscl_TagTree< T, Alloc >::erase | ( | iterator | position | ) | `[inline]`

  | Erases the element pointed to by the iterator. If the node has children, then the node will not be erased from the tree. It will be replaced with the default node value. Parameters:
  position | Iterator pointing to the node to be erased

template<class T, class Alloc>
iterator Oscl_TagTree< T, Alloc >::find | ( | const tag_base_type & | x | ) | `[inline]`

| Finds an element whose key is x Returns: returns an iterator to the element with key x. If no element is found, returns end()

template<class T, class Alloc>
pair_iterator_bool Oscl_TagTree< T, Alloc >::insert | ( | const tag_base_type & | t,
|  | const T & | x
| ) | `[inline]`

  | Inserts x into the tree and associates it with tag t. If the tag already exists x will not be inserted, and an iterator pointing to the existing node with tag t is returned. Parameters:
  t | tag to use
  x | element to insert
Returns: Returns a pair of parameters, iterator and bool. The iterator points to the inserted node containing x. If the tag t already existed, then the iterator points to the node associated with tag t. The bool is true if x was inserted and false if it was not inserted due to an existing node with tag t.

template<class T, class Alloc>
Oscl_TagTree<T, Alloc>& Oscl_TagTree< T, Alloc >::operator= | ( | const Oscl_TagTree< T, Alloc > & | x | ) | `[inline]`

| Assignment operator

template<class T, class Alloc>
T& Oscl_TagTree< T, Alloc >::operator[] | ( | const tag_base_type & | t | ) | `[inline]`

| Returns a reference to the object that is associated with a particular tag. If the map does not already contain such an object, operator[] inserts the default object T().

template<class T, class Alloc>
size_type Oscl_TagTree< T, Alloc >::size | ( |  | ) | const`[inline]`

| Returns the number of nodes stored in the tree

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

- oscl_tagtree.h