Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

dtpf::ParameterTree Class Reference

#include <ParameterTree.h>

Inheritance diagram for dtpf::ParameterTree:

dtpf::ParameterGroup dtpf::ParameterTreeVertex List of all members.

Detailed Description

ParameterTree provides hierarchial organization of ParameterGroupss and Parameters for use by DTPF Nodes and client applications.

A ParameterTree can contain Parameters and other ParameterGroups.


Public Member Functions

 ParameterTree ()
 Create an empty, unnamed ParameterTree.
 ParameterTree (const muscle::String &name)
 Create an empty, named ParameterTree.
 ParameterTree (const ParameterTree &that)
 Create a deep copy of an existing ParameterTree, recursively including all children.
virtual ~ParameterTree ()
 Delete a ParameterTree and any memory it owns.
ParameterTreeoperator= (const ParameterTree &that)
 Assign a ParameterTree from another.
bool operator== (const ParameterTree &that) const
 Compare against another ParameterTree for equality.
bool operator!= (const ParameterTree &that) const
 Compare against another ParameterTree for inequality.
status_t AddChild (ParameterGroup *child)
 Add a child ParameterGroup.
ParameterGroupRemoveChild (ParameterGroup *child)
 Remove a child from a ParameterTree.
ParameterGroupRemoveChild (const muscle::String &childName)
 Remove a child from a ParameterTree by name.
bool HasChild (ParameterGroup *child) const
 Find out if a ParameterGroup is the child of an ParameterTree.
bool HasChild (const muscle::String &childName) const
 Find out if a ParameterTree contains a child with the given name.
ParameterGroupGetChild (const muscle::String &childName) const
 Retrieve a child ParameterGroup.
const muscle::List< ParameterGroup * > & GetChildren () const
 Retrieve a list of a ParameterTree's children.
uint32 CountChildren () const
 Get the number of child ParameterGroups a ParameterTree contains.
status_t ParameterChanged (ParameterTree *updateTree)
 Update parameters when they are changed to reflect the current state.
virtual uint32 TypeCode () const
 Get a type code identifying the ParameterTree class.
virtual uint32 FlattenedSize () const
 Returns the number of bytes needed to store a ParameterTree object in its current state.
virtual void Flatten (uint8 *buffer) const
 Write a ParameterTree's state to a byte array.
virtual status_t Unflatten (const uint8 *buffer, uint32 size)
 Set a ParameterTree's state from a byte buffer.


Constructor & Destructor Documentation

dtpf::ParameterTree::ParameterTree  ) 
 

Create an empty, unnamed ParameterTree.

A name must be given to the tree before it can be used.

dtpf::ParameterTree::ParameterTree const muscle::String &  name  ) 
 

Create an empty, named ParameterTree.

Parameters:
name The name of the tree.

dtpf::ParameterTree::ParameterTree const ParameterTree that  ) 
 

Create a deep copy of an existing ParameterTree, recursively including all children.

Parameters:
that The ParameterTree to copy from.

virtual dtpf::ParameterTree::~ParameterTree  )  [virtual]
 

Delete a ParameterTree and any memory it owns.


Member Function Documentation

status_t dtpf::ParameterTree::AddChild ParameterGroup child  ) 
 

Add a child ParameterGroup.

If addition is successful, the ParameterTree this function is called on takes ownership of the child provided as an argument.

Parameters:
child A pointer to the ParameterGroup to add.
Returns:
E_OK if the child was successfully added. An appropriate error code is returned if: the parent group is unnamed, child is NULL or otherwise invalid, or errors were encountered internally.

uint32 dtpf::ParameterTree::CountChildren  )  const
 

Get the number of child ParameterGroups a ParameterTree contains.

Returns:
The number of children.

virtual void dtpf::ParameterTree::Flatten uint8 *  buffer  )  const [virtual]
 

Write a ParameterTree's state to a byte array.

Parameters:
buffer The byte array to write to. The caller should ensure that this is at least FlattenedSize() bytes in length.

Reimplemented from dtpf::ParameterGroup.

virtual uint32 dtpf::ParameterTree::FlattenedSize  )  const [virtual]
 

Returns the number of bytes needed to store a ParameterTree object in its current state.

Returns:
The flattened size for a ParameterTree object.

Reimplemented from dtpf::ParameterGroup.

ParameterGroup* dtpf::ParameterTree::GetChild const muscle::String &  childName  )  const
 

Retrieve a child ParameterGroup.

The ParameterTree maintains ownership of the returned child.

Parameters:
childName The name of the child to retrieve.
Returns:
A pointer to the child in question or NULL if it is not a child.

const muscle::List<ParameterGroup*>& dtpf::ParameterTree::GetChildren  )  const
 

Retrieve a list of a ParameterTree's children.

If this group has no children the returned list will be empty.

Returns:
A muscle::List of pointers to this ParameterTree's children.

The ParameterTree retains ownership of the children in the returned list.

bool dtpf::ParameterTree::HasChild const muscle::String &  childName  )  const
 

Find out if a ParameterTree contains a child with the given name.

Parameters:
childName The name of the child in question.
Returns:
True if this ParameterTree contains a child with the given name.

bool dtpf::ParameterTree::HasChild ParameterGroup child  )  const
 

Find out if a ParameterGroup is the child of an ParameterTree.

Parameters:
child A pointer to the child in question.
Returns:
True if this ParameterTree contains the given child.

bool dtpf::ParameterTree::operator!= const ParameterTree that  )  const
 

Compare against another ParameterTree for inequality.

This is the logical negation of the == operator.

Parameters:
that The ParameterTree to compare against.
Returns:
True if the two ParameterTrees are not equal, false otherwise.

ParameterTree& dtpf::ParameterTree::operator= const ParameterTree that  ) 
 

Assign a ParameterTree from another.

Copies will recursively be made of all children in the parameter tree rooted at the copied ParameterTree.

Parameters:
that The ParameterTree to assign from.
Returns:
A reference to *this.

bool dtpf::ParameterTree::operator== const ParameterTree that  )  const
 

Compare against another ParameterTree for equality.

Two ParameterTrees are equal iff they represent the same parameter tree, that is they have the same name and their Parameters and children are all equivalent. This operates recursively comparing all children.

Parameters:
that The ParameterTree to compare against.
Returns:
True if the two ParameterTrees are equal, false otherwise.

status_t dtpf::ParameterTree::ParameterChanged ParameterTree updateTree  ) 
 

Update parameters when they are changed to reflect the current state.

Parameters:
updateTree A ParameterTree containing any updated Parameters.
Returns:
E_OK if the parameters were updated successfully.

E_??? if the contents of updateTree are not compatible (i.e., updateTree contains Parameters that this ParameterTree does not).

ParameterGroup* dtpf::ParameterTree::RemoveChild const muscle::String &  childName  ) 
 

Remove a child from a ParameterTree by name.

After removal the caller gains ownership of the child.

Parameters:
childName The name of the child to remove.
Returns:
The child that was removed or NULL if this ParameterTree has no child named childName.

ParameterGroup* dtpf::ParameterTree::RemoveChild ParameterGroup child  ) 
 

Remove a child from a ParameterTree.

After removal the caller gains ownership of the child.

Parameters:
child The child to remove.
Returns:
The child that was removed or NULL if child is not a child of this ParameterTree.

virtual uint32 dtpf::ParameterTree::TypeCode  )  const [virtual]
 

Get a type code identifying the ParameterTree class.

Returns:
The type code for the ParameterTree class.

Reimplemented from dtpf::ParameterGroup.

virtual status_t dtpf::ParameterTree::Unflatten const uint8 *  buffer,
uint32  size
[virtual]
 

Set a ParameterTree's state from a byte buffer.

Parameters:
buffer The byte array to unflatten from.
size The length of buffer.
Returns:
E_OK if successful

E_BAD_ARGUMENT if buffer is null or size is less than FlattenedSize().

Reimplemented from dtpf::ParameterGroup.


The documentation for this class was generated from the following file:
Generated on Wed Aug 3 07:26:19 2005 for DTPF by  doxygen 1.3.9.1