Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

DWFToolkit::DWFPropertyContainer Class Reference
[DWF Package API]

#include "dwf/package/utility/PropertyContainer.h"

Inheritance diagram for DWFToolkit::DWFPropertyContainer:

Inheritance graph
[legend]
Collaboration diagram for DWFToolkit::DWFPropertyContainer:

Collaboration graph
[legend]
List of all members.

Detailed Description

An auto-mapping collection utility for DWFResource objects.
Since:
7.0.1.

This class is a property owner. As properties are added to the container, they are associated in internal maps for fast, multi-keyed look-up.

Todo:
Consider deriving DWFPropertyContainer from DWFCore::DWFOwnable, for consistent behavior with the rest of the API.
Examples:

3DPublish/3DPublish_UTF8.cpp, GlobalSectionWriter/GlobalSectionWriter.cpp, ObjectDefinitionReader/ObjectDefinitionReader.cpp, and SimpleEPlotWriter/SimpleEPlotWriter_UTF8.cpp.

Definition at line 50 of file PropertyContainer.h.

Public Types

typedef vector< DWFPropertyContainer * > tList
 This type defines a list of DWFPropertyContainer pointers.

Public Member Functions

_DWFTK_API DWFPropertyContainer (const DWFString &zID=L"") throw ()
virtual _DWFTK_API ~DWFPropertyContainer () throw ()
virtual const DWFStringid () const
virtual _DWFTK_API const DWFProperty
*const 
findProperty (const DWFString &zName, const DWFString &zCategory=L"") throw ()
virtual _DWFTK_API DWFProperty::tMap::Iterator * getProperties (const DWFString &zCategory=L"") throw ()
virtual _DWFTK_API void addProperty (DWFProperty *pProperty, bool bOwnProperty) throw ( DWFException )
virtual _DWFTK_API void addPropertyContainer (DWFPropertyContainer *pContainer) throw ( DWFException )
virtual _DWFTK_API void referencePropertyContainer (const DWFPropertyContainer &rContainer) throw ( DWFException )
virtual _DWFTK_API void getOwnedPropertyContainers (DWFPropertyContainer::tList &rContainerList) throw ( DWFException )
virtual _DWFTK_API void getReferencedPropertyContainers (DWFPropertyContainer::tList &rContainerList) throw ( DWFException )
virtual _DWFTK_API void getAllPropertyContainers (DWFPropertyContainer::tList &rContainerList) throw ( DWFException )
virtual _DWFTK_API void removeOwnedPropertyContainers (DWFPropertyContainer::tList &rContainerList, bool bMakeReferences=false) throw ( DWFException )
virtual _DWFTK_API void removeReferencedPropertyContainers (DWFPropertyContainer::tList &rContainerList) throw ( DWFException )
virtual _DWFTK_API void removeAllPropertyContainers (DWFPropertyContainer::tList &rContainerList) throw ( DWFException )
virtual _DWFTK_API void copyProperties (DWFPropertyContainer &rContainer, bool bRemoveOwnership=false, bool bMakeReferences=false) throw ( DWFException )
DWFXMLSerializablegetSerializable () const throw ()

Protected Member Functions

virtual _DWFTK_API void notifyOwnerChanged (DWFOwnable &rOwnable) throw ( DWFException )
virtual _DWFTK_API void notifyOwnableDeletion (DWFOwnable &rOwnable) throw ( DWFException )

Protected Attributes

DWFProperty::tMap _oProperties
 The main collection of properties, dual keyed by their names and categories.
DWFPropertyContainer::tList _oContainers
 The collection of sub-containers.
DWFPropertyContainer::tList _oReferences
 The collection of sub-containers that are only referenced by this container.


Constructor & Destructor Documentation

_DWFTK_API DWFToolkit::DWFPropertyContainer::DWFPropertyContainer const DWFString zID = L""  )  throw ()
 

Constructor

Parameters:
zID An optional identifier used when referencing this container.
Exceptions:
None 

virtual _DWFTK_API DWFToolkit::DWFPropertyContainer::~DWFPropertyContainer  )  throw () [virtual]
 

Destructor

This method will delete only those properties that are owned by this object.

Exceptions:
None 


Member Function Documentation

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::addProperty DWFProperty pProperty,
bool  bOwnProperty
throw ( DWFException ) [virtual]
 

Inserts a property to the container.

Parameters:
pProperty The property to add to the container (must not be NULL).
bOwnProperty If true, the container will claim ownership of the property and delete it using the DWFCORE_FREE_OBJECT macro upon destruction of this container if it is still owned.
Exceptions:
DWFException 

Reimplemented in DWFToolkit::DWFSegment.

Examples:
3DPublish/3DPublish_UTF8.cpp, GlobalSectionWriter/GlobalSectionWriter.cpp, and SimpleEPlotWriter/SimpleEPlotWriter_UTF8.cpp.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::addPropertyContainer DWFPropertyContainer pContainer  )  throw ( DWFException ) [virtual]
 

Inserts another property container directly into the container.

Use this method to create sets of properties within a larger property [container] context. Inner containers will be serialized as inner sets. To publish set references, use the referencePropertyContainer() method.

Parameters:
pContainer The container to add to this container (must not be NULL). This pointer will be owned by this container and deleted using the DWFCORE_FREE_OBJECT.
Exceptions:
DWFException 

Reimplemented in DWFToolkit::DWFSegment.

Examples:
GlobalSectionWriter/GlobalSectionWriter.cpp.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::copyProperties DWFPropertyContainer rContainer,
bool  bRemoveOwnership = false,
bool  bMakeReferences = false
throw ( DWFException ) [virtual]
 

Copies all properties and inner containers from another container.

Parameters:
rContainer The container from which to copy properties and property containers.
bRemoveOwnership If true, this container will assume ownership of all of the the containers owned by rContainer by calling it's removeOwnedPropertyContainers() method. If false, this container will reference all of the containers owned by rContainer. Irrespective of this flag, all inner containers referenced by rContainer will be again referenced by this container.
bMakeReferences If bRemoveOwnership is true, this flag will be passed to the removeOwnedPropertyContainers() method of rContainer.
Exceptions:
None 

Reimplemented in DWFToolkit::DWFSegment.

virtual _DWFTK_API const DWFProperty* const DWFToolkit::DWFPropertyContainer::findProperty const DWFString zName,
const DWFString zCategory = L""
throw () [virtual]
 

Locates a property in the container.

Parameters:
zName The name of the property to look up (required.)
zCategory The category of the property to look up (optional.)
Returns:
A pointer to the property (may be NULL). This object is owned by the container by default and must not be deleted by the caller without first explicitly claiming ownership.
Exceptions:
None 

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::getAllPropertyContainers DWFPropertyContainer::tList rContainerList  )  throw ( DWFException ) [virtual]
 

Returns a list of all inner property containers.

Parameters:
rContainerList A list to which the container pointers are to be added. These pointers must not be deleted by the caller.
Exceptions:
DWFException 
Todo:
For API consistency, consider modifying this method to return an interator.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::getOwnedPropertyContainers DWFPropertyContainer::tList rContainerList  )  throw ( DWFException ) [virtual]
 

Returns a list of only those property containers that have been directly added with the addPropertyContainer() method.

These inner containers are considered as owned by this object.

Parameters:
rContainerList A list to which the container pointers are to be added. These pointers must not be deleted by the caller.
Exceptions:
DWFException 
Todo:
For API consistency, consider modifying this method to return an interator.

virtual _DWFTK_API DWFProperty::tMap::Iterator* DWFToolkit::DWFPropertyContainer::getProperties const DWFString zCategory = L""  )  throw () [virtual]
 

Locates all properties in the container that share a category.

Parameters:
zCategory The property category to search by.
Returns:
A pointer an iterator for enumerating the properties (may be NULL). This pointer must be deleted by the caller with the DWFCORE_FREE_OBJECT macro. Properties returned from the iterator are owned by the container by default and must not be deleted by the caller without first explicitly claiming ownership.
Exceptions:
None 

Reimplemented in DWFToolkit::DWFSegment.

Examples:
ObjectDefinitionReader/ObjectDefinitionReader.cpp, and SimpleEnumReader/SimpleEnumReader.cpp.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::getReferencedPropertyContainers DWFPropertyContainer::tList rContainerList  )  throw ( DWFException ) [virtual]
 

Returns a list of only those property containers that have been added as references with the referencePropertyContainer() method.

Parameters:
rContainerList A list to which the container pointers are to be added. These pointers must not be deleted by the caller.
Exceptions:
DWFException 
Todo:
For API consistency, consider modifying this method to return an interator.

DWFXMLSerializable& DWFToolkit::DWFPropertyContainer::getSerializable  )  const throw () [inline]
 

Returns an interface with which the container can be serialized into an XML document.

Returns:
A reference to a serialization inteface.
Exceptions:
None 

Definition at line 289 of file PropertyContainer.h.

virtual const DWFString& DWFToolkit::DWFPropertyContainer::id  )  const [inline, virtual]
 

Returns the reference identifier for this container.

Returns:
The reference ID.
Exceptions:
None 

Reimplemented in DWFToolkit::DWFDefinedObject.

Definition at line 90 of file PropertyContainer.h.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::notifyOwnableDeletion DWFOwnable rOwnable  )  throw ( DWFException ) [protected, virtual]
 

Reimplemented from DWFCore::DWFOwner.

Reimplemented in DWFToolkit::DWFManifest.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::notifyOwnerChanged DWFOwnable rOwnable  )  throw ( DWFException ) [protected, virtual]
 

Reimplemented from DWFCore::DWFOwner.

Reimplemented in DWFToolkit::DWFManifest.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::referencePropertyContainer const DWFPropertyContainer rContainer  )  throw ( DWFException ) [virtual]
 

Inserts another property container by reference into the container.

Use this method to create references to other sets of properties within a larger property [container] context. Inner containers will be serialized as reference IDs. To publish inlined inner sets, use the addPropertyContainer() method.

Parameters:
rContainer The container to add to this container as a reference.
Exceptions:
DWFException 

Reimplemented in DWFToolkit::DWFSegment.

Examples:
GlobalSectionWriter/GlobalSectionWriter.cpp.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::removeAllPropertyContainers DWFPropertyContainer::tList rContainerList  )  throw ( DWFException ) [virtual]
 

Removes from the container and returns in a list, all inner containers.

Parameters:
rContainerList A list to which the container pointers are to be added.
Exceptions:
DWFException 
Todo:
For API consistency, consider modifying this method to return an interator.

Reimplemented in DWFToolkit::DWFSegment.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::removeOwnedPropertyContainers DWFPropertyContainer::tList rContainerList,
bool  bMakeReferences = false
throw ( DWFException ) [virtual]
 

Removes from the container and returns in a list, those property containers that have been directly added with the addPropertyContainer() method.

These inner containers are considered as owned by this object.

Parameters:
rContainerList A list to which the container pointers are to be added. These pointers are now the responsibility of the caller and must be deleted with the DWFCORE_FREE_OBJECT macro.
bMakeReferences If true, the inner containers removed by this method will be add to the referenced inner container list.
Exceptions:
DWFException 
Todo:
For API consistency, consider modifying this method to return an interator.

Reimplemented in DWFToolkit::DWFSegment.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::removeReferencedPropertyContainers DWFPropertyContainer::tList rContainerList  )  throw ( DWFException ) [virtual]
 

Removes from the container and returns in a list, those property containers that have been added as references with the referencePropertyContainer() method.

Parameters:
rContainerList A list to which the container pointers are to be added. These pointers must not be deleted by the caller.
Exceptions:
DWFException 
Todo:
For API consistency, consider modifying this method to return an interator.

Reimplemented in DWFToolkit::DWFSegment.


The documentation for this class was generated from the following file:
Generated on Tue May 17 12:39:09 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1