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

dtpf::ParameterGroup Class Reference

#include <ParameterGroup.h>

Inheritance diagram for dtpf::ParameterGroup:

dtpf::ParameterTreeVertex dtpf::DataFormat dtpf::ParameterTree List of all members.

Detailed Description

ParameterGroup provides grouping and management of Parameters for use by DTPF Nodes and client applications.

A ParameterGroup can contain Parameters and other ParameterGroups. Inherits from muscle::Flattenable to support writing the state to a byte array.


Public Member Functions

 ParameterGroup ()
 Create an empty, unnamed ParameterGroup.
 ParameterGroup (const muscle::String &name)
 Create an empty, named ParameterGroup.
 ParameterGroup (const ParameterGroup &that)
 Create a deep copy of an existing ParameterGroup, recursively including all children.
virtual ~ParameterGroup ()
 Delete a ParameterGroup and any memory it owns.
ParameterGroupoperator= (const ParameterGroup &that)
 Assign a ParameterGroup from another.
bool operator== (const ParameterGroup &that) const
 Compare against another ParameterGroup for equality.
bool operator!= (const ParameterGroup &that) const
 Compare against another ParameterGroup for inequality.
status_t AddParameter (Parameter *param)
 Add a Parameter.
ParameterRemoveParameter (Parameter *param)
 Remove a given Parameter.
ParameterRemoveParameter (const muscle::String &paramName)
 Remove a given Parameter by name.
bool HasParameter (Parameter *param) const
 Find out if a ParameterGroup contains a Parameter.
bool HasParameter (const muscle::String &paramName) const
 Find out if a ParameterGroup contains a Parameter by name.
ParameterGetParameter (const muscle::String &paramName) const
 Retrieve a Parameter by name.
const muscle::List< Parameter * > & GetParameters () const
 Retrieve a list of Parameters contained in a ParameterGroup.
uint32 CountParameters () const
 Get the number of Parameters a ParameterGroup contains.
status_t ParameterChanged (ParameterGroup *updateGroup)
 Update parameters when they are changed to reflect the current state.
virtual uint32 TypeCode () const
 Get the type code for the ParameterGroup class.
virtual uint32 FlattenedSize () const
 Returns the number of bytes needed to store a ParameterGroup object in its current state.
virtual void Flatten (uint8 *buffer) const
 Write a ParameterGroup's state to a byte array.
virtual status_t Unflatten (const uint8 *buffer, uint32 size)
 Set a ParameterGroup object's state from a byte array.


Constructor & Destructor Documentation

dtpf::ParameterGroup::ParameterGroup  ) 
 

Create an empty, unnamed ParameterGroup.

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

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

Create an empty, named ParameterGroup.

Parameters:
name The name of the group.

dtpf::ParameterGroup::ParameterGroup const ParameterGroup that  ) 
 

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

Parameters:
that The ParameterGroup to copy from.

virtual dtpf::ParameterGroup::~ParameterGroup  )  [virtual]
 

Delete a ParameterGroup and any memory it owns.


Member Function Documentation

status_t dtpf::ParameterGroup::AddParameter Parameter param  ) 
 

Add a Parameter.

The ParameterGroup will take ownership of the added parameter if this operation is successful.

Parameters:
param The Parameter to add.
Returns:
E_OK if addition was successful, an appropriate error code otherwise.

uint32 dtpf::ParameterGroup::CountParameters  )  const
 

Get the number of Parameters a ParameterGroup contains.

Returns:
The number of Parameters.

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

Write a ParameterGroup'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::ParameterTreeVertex.

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

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

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

Returns:
The flattened size for a ParameterGroup object.

Reimplemented from dtpf::ParameterTreeVertex.

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

Parameter* dtpf::ParameterGroup::GetParameter const muscle::String &  paramName  )  const
 

Retrieve a Parameter by name.

This does not consider child ParameterGroups.

Parameters:
paramName The name of the Parameter.
Returns:
A pointer to the desired Parameter if present, NULL otherwise.

The ParameterGroup maintains ownership of the returned Parameter.

const muscle::List<Parameter*>& dtpf::ParameterGroup::GetParameters  )  const
 

Retrieve a list of Parameters contained in a ParameterGroup.

If this group contains no Parameters the returned list will be empty. This does not consider child ParameterGroups.

Returns:
A muscle::List of pointers to the Parameters.

The ParameterGroup retains ownership of the returned Parameters.

bool dtpf::ParameterGroup::HasParameter const muscle::String &  paramName  )  const
 

Find out if a ParameterGroup contains a Parameter by name.

This does not consider child ParameterGroups.

Parameters:
paramName The name of the Parameter in question.
Returns:
True if this ParameterGroup contains a Parameter with the given name.

bool dtpf::ParameterGroup::HasParameter Parameter param  )  const
 

Find out if a ParameterGroup contains a Parameter.

This does not consider child ParameterGroups.

Parameters:
param A pointer to the Parameter in question.
Returns:
True if this ParameterGroup contains the given Parameter.

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

Compare against another ParameterGroup for inequality.

This is the logical negation of the == operator.

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

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

Assign a ParameterGroup from another.

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

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

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

Compare against another ParameterGroup for equality.

Two ParameterGroups 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 the children as well.

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

status_t dtpf::ParameterGroup::ParameterChanged ParameterGroup updateGroup  ) 
 

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

Parameters:
updateGroup A ParameterGroup containing any updated Parameters.
Returns:
E_OK if the parameters were updated successfully.

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

Parameter* dtpf::ParameterGroup::RemoveParameter const muscle::String &  paramName  ) 
 

Remove a given Parameter by name.

This does not consider child ParameterGroups. After successful removal the caller gains ownership of the returned Parameter.

Parameters:
paramName The name of the parameter to remove.
Returns:
A pointer to the removed Parameter or NULL if this ParameterGroup does not contain a Parameter with the given name.

Parameter* dtpf::ParameterGroup::RemoveParameter Parameter param  ) 
 

Remove a given Parameter.

This does not consider child ParameterGroups. After successful removal, the caller gains ownership of the returned Parameter.

Parameters:
param The parameter to remove.
Returns:
A pointer to the removed Parameter or NULL if this ParameterGroup does not contain the given Parameter.

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

Get the type code for the ParameterGroup class.

Returns:
The ParameterGroup type code.

Implements dtpf::ParameterTreeVertex.

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

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

Set a ParameterGroup object's state from a byte array.

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::ParameterTreeVertex.

Reimplemented in dtpf::DataFormat, 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