UFGroup Class Reference

UFGroup is a UFObject that contain a group of UFObject elements. More...

#include <ufobject.h>

Inheritance diagram for UFGroup:
Inheritance graph
[legend]
Collaboration diagram for UFGroup:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 UFGroup (UFName name, const char *label="")
 Construct an empty UFGroup, containing no objects.
 ~UFGroup ()
 Destroy a UFGroup after destroying all the objects it contains.
std::string XML (const char *indent="") const
 Create an XML block for the object.
void Set (const UFObject &object)
void Set (const char *string)
 Set the value of the object from the string value.
bool IsDefault () const
 Return true if object has its default value.
void SetDefault ()
 Set the current object value to its default value.
void Reset ()
 Reset the object value to its default value.
bool Has (UFName name) const
 Return true if the UFGroup contains an object called name.
UFObjectoperator[] (UFName name)
 Access a UFObject element in a UFGroup.
const UFObjectoperator[] (UFName name) const
 Access a constant UFObject element in a constant UFGroup.
virtual UFGroupoperator<< (UFObject *object)
 Add (append) a UFObject to a UFGroup.
UFObjectDrop (UFName name)
 Drop an object from the group.
void Clear ()
 Remove all elements from the group.

Detailed Description

UFGroup is a UFObject that contain a group of UFObject elements.

This object is considered the Patent() of these elements.


Constructor & Destructor Documentation

UFGroup::UFGroup ( UFName  name,
const char *  label = "" 
) [explicit]

Construct an empty UFGroup, containing no objects.

The label is used to index the UFGroup inside a UFArray.

UFGroup::~UFGroup (  ) 

Destroy a UFGroup after destroying all the objects it contains.


Member Function Documentation

std::string UFGroup::XML ( const char *  indent = ""  )  const [virtual]

Create an XML block for the object.

If the object value is its default, create and empty XML block.

Parameters:
indent - Controls the XML block indentations.

Reimplemented from UFObject.

Reimplemented in UFArray.

void UFGroup::Set ( const UFObject object  ) 

Reimplemented in UFArray.

void UFGroup::Set ( const char *  string  )  [virtual]

Set the value of the object from the string value.

This is the reverse of the StringValue() method. If the value changes, an uf_value_changed event is triggered.

Exceptions:
UFException is thrown if the the string can not be converted to the object type. This could result from a user input error.

Implements UFObject.

Reimplemented in UFArray.

bool UFGroup::IsDefault (  )  const [virtual]

Return true if object has its default value.

For numerical objects, the values has to the same up to the prescribed accuracy.

Implements UFObject.

Reimplemented in UFArray.

void UFGroup::SetDefault (  )  [virtual]

Set the current object value to its default value.

A uf_default_changed event is triggered.

Implements UFObject.

Reimplemented in UFArray.

void UFGroup::Reset (  )  [virtual]

Reset the object value to its default value.

If the value changes, a uf_value_changed event is triggered.

Implements UFObject.

Reimplemented in UFArray.

bool UFGroup::Has ( UFName  name  )  const

Return true if the UFGroup contains an object called name.

UFObject& UFGroup::operator[] ( UFName  name  ) 

Access a UFObject element in a UFGroup.

Exceptions:
UFException is thrown if an element with the given name does not exist. This can be avoided with the use of the Has() method.
const UFObject& UFGroup::operator[] ( UFName  name  )  const

Access a constant UFObject element in a constant UFGroup.

Exceptions:
UFException is thrown if an element with the given name does not exist. This can be avoided with the use of the Has() method.
virtual UFGroup& UFGroup::operator<< ( UFObject object  )  [virtual]

Add (append) a UFObject to a UFGroup.

If the object belonged to another group before, it will be detached from the original group.

Exceptions:
UFException is thrown if UFGroup already contains an object with the same name. This can be avoided with the use of the Has() method.

Reimplemented in UFArray.

UFObject& UFGroup::Drop ( UFName  name  ) 

Drop an object from the group.

The dropped object is returned. If it is not needed any more it should be deleted to free its memory.

Exceptions:
UFException is thrown if an element with the given name does not exist. This can be avoided with the use of the Has() method. For UFArray, the index does not get updated.
void UFGroup::Clear (  ) 

Remove all elements from the group.

The removed elements are deleted from memory. For UFArray, the index does not get updated.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Wed Mar 17 21:05:32 2010 for UFRaw by  doxygen 1.6.1