Development/Cpp/Helper/OPropertyContainerHelper

From Apache OpenOffice Wiki
< Development‎ | Cpp‎ | Helper
Revision as of 09:07, 29 November 2007 by Frank Schoenheit (Talk | contribs)

Jump to: navigation, search
Class Name Purpose Location
PropertyContainerHelper is a helper class for managing property values, and implementing most of the property set related interfaces comphelper/propertycontainerhelper.hxx


Description

A PropertyContainerHelper manages a set of properties and property values.

A property is described by all the attributes required by a css.beans.Property: Name, Handle, Type, and Attributes. A PropertyContainerHelper allows you to specify an arbitrary number of properties, and keeps track of them, later being able to hand out a structure describing them.

What makes the class powerful is that together with a property description the class also manages the location where the actual property value is stored. When you register a property, you also register the location (or let the PropertyContainerHelper find one) of the property value. From then on, every read access to the property will return the value stored in the location, and every write access will change the value in this location.

This is especially useful together with member variables: If your class implements the property set related interfaces, and you also want a quick, typed access to the actual property values, you can declare a class member, and register this member as location of a property's value. Then, read and write access to the member is equivalent to read and write access to the property value, using PropertyContainerHelper's methods.

Interface

TODO: There's more to come here ...

Example

TODO: There's more to come here ...

Personal tools