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

dtpf::ParameterTreeVertex Class Reference

#include <ParameterTreeVertex.h>

Inheritance diagram for dtpf::ParameterTreeVertex:

dtpf::Parameter dtpf::ParameterGroup dtpf::SpecificParameter dtpf::DataFormat dtpf::ParameterTree dtpf::FileParameter dtpf::GroupParameter dtpf::OnOffParameter dtpf::RangeParameter dtpf::TextParameter List of all members.

Detailed Description

A vertex in a parameter tree implementing the General Hierarchy design pattern for DTPF configuration parameters.

Encapsulates common attributes and functionality common to items in a parameter tree (Parameters and ParameterGroups). This encompasses the name and path in the tree of a vertex, its parent (if any), the NodeID of the node it is associated with, and flattening and unflattening via the muscle::Flattenable interface.


Public Member Functions

virtual ~ParameterTreeVertex ()
 Delete a ParameterTreeVertex and any memory it owns.
virtual void SetName (const muscle::String &name)
 Set a ParameterTreeVertex's name.
virtual muscle::String GetName () const
 Retrieve a ParameterTreeVertex's name.
virtual muscle::String GetPath () const
 Retrieve a ParameterTreeVertex's path in a parameter tree.
virtual void SetParent (ParameterVertex *parent)
 Set the parent of a vertex.
virtual ParameterTreeVertexGetParent () const
 Retieve a ParameterTreeVertex's parent if any.
virtual void SetNode (NodeID id)
 Set the NodeID for a ParameterTreeVertex.
virtual NodeID GetNode () const
 Retrieve the NodeID for a ParameterTreeVertex.
virtual bool IsFixedSize () const
 Indicates that ParameterTreeVertex instances have variable flattened sizes.
virtual uint32 TypeCode () const =0
 Subclasses of ParameterTreeVertex override this function to return a code identifying the subclass type.
virtual uint32 FlattenedSize () const
 Returns the number of bytes needed to store a ParameterTreeVertex object in its current state.
virtual void Flatten (uint8 *buffer) const
 Write a ParameterTreeVertex's state to a byte array.
virtual bool AllowsTypeCode (uint32 code)
 Indicates whether a buffer containing data of type code can be unflattened to an instance of a ParameterTreeVertex subclass.
virtual status_t Unflatten (const uint8 *buffer, uint32 size)
 Set an object's state from a byte array.

Protected Member Functions

 ParameterTreeVertex ()
 Create an unnamed ParameterTreeVertex with no parent.
 ParameterTreeVertex (const muscle::String &name)
 Create a named ParameterTreeVertex with no parent.


Constructor & Destructor Documentation

virtual dtpf::ParameterTreeVertex::~ParameterTreeVertex  )  [virtual]
 

Delete a ParameterTreeVertex and any memory it owns.

dtpf::ParameterTreeVertex::ParameterTreeVertex  )  [protected]
 

Create an unnamed ParameterTreeVertex with no parent.

A name must be given to the vertex before it can be considered to have a place in a tree. A vertex without a parent is considered to be the root of its own tree.

dtpf::ParameterTreeVertex::ParameterTreeVertex const muscle::String &  name  )  [protected]
 

Create a named ParameterTreeVertex with no parent.

Parameters:
name The name of the vertex.


Member Function Documentation

virtual bool dtpf::ParameterTreeVertex::AllowsTypeCode uint32  code  )  [virtual]
 

Indicates whether a buffer containing data of type code can be unflattened to an instance of a ParameterTreeVertex subclass.

See also:
muscle::Flattenable::AllowsTypeCode().
Parameters:
code The type code in question.
Returns:
True iff code == TypeCode().

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

Write a ParameterTreeVertex's state to a byte array.

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

Reimplemented in dtpf::DataFormat, dtpf::Parameter, dtpf::ParameterGroup, and dtpf::ParameterTree.

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

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

Overridden to return the flattened size for a particular subclass.

See also:
muscle::Flattenable::FlattenedSize().
Returns:
The flattened size for a ParameterTreeVertex object.

Reimplemented in dtpf::DataFormat, dtpf::Parameter, dtpf::ParameterGroup, and dtpf::ParameterTree.

virtual muscle::String dtpf::ParameterTreeVertex::GetName  )  const [virtual]
 

Retrieve a ParameterTreeVertex's name.

Returns:
The name of the ParameterTreeVertex.

virtual NodeID dtpf::ParameterTreeVertex::GetNode  )  const [virtual]
 

Retrieve the NodeID for a ParameterTreeVertex.

Returns:
The NodeID.

virtual ParameterTreeVertex* dtpf::ParameterTreeVertex::GetParent  )  const [virtual]
 

Retieve a ParameterTreeVertex's parent if any.

Returns:
A pointer to the vertex's parent or NULL if it has no parent.

virtual muscle::String dtpf::ParameterTreeVertex::GetPath  )  const [virtual]
 

Retrieve a ParameterTreeVertex's path in a parameter tree.

Returns:
The path of the ParameterTreeVertex in the parameter tree.

The empty string "" if the vertex does not have a name.

"/" + Name() if the vertex has a name but does not have a parent.

Parent()->Path() + "/" + Name() if the vertex has a name and a parent.

virtual bool dtpf::ParameterTreeVertex::IsFixedSize  )  const [virtual]
 

Indicates that ParameterTreeVertex instances have variable flattened sizes.

See also:
muscle::Flattenable::().
Returns:
False since the flattened size of most vertices will vary depending on the vertex and its contents.

virtual void dtpf::ParameterTreeVertex::SetName const muscle::String &  name  )  [virtual]
 

Set a ParameterTreeVertex's name.

Parameters:
name The new name for the ParameterTreeVertex.

virtual void dtpf::ParameterTreeVertex::SetNode NodeID  id  )  [virtual]
 

Set the NodeID for a ParameterTreeVertex.

Parameters:
id The NodeID.

virtual void dtpf::ParameterTreeVertex::SetParent ParameterVertex *  parent  )  [virtual]
 

Set the parent of a vertex.

Parameters:
parent The parent vertex.

virtual uint32 dtpf::ParameterTreeVertex::TypeCode  )  const [pure virtual]
 

Subclasses of ParameterTreeVertex override this function to return a code identifying the subclass type.

See also:
muscle::Flattenable::TypeCode().
Returns:
The type code.

Implemented in dtpf::DataFormat, dtpf::Parameter, dtpf::ParameterGroup, and dtpf::ParameterTree.

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

Set an object's state from a byte array.

The ParameterTreeVertex implementation recovers the name, parent and node identifier.

See also:
muscle::Flattenable::Unflatten().
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 in dtpf::DataFormat, dtpf::Parameter, dtpf::ParameterGroup, and dtpf::ParameterTree.


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