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:

GlobalSectionWriter/GlobalSectionWriter.cpp, ReadContentDefinition/ReadContentDefinition.cpp, and SimpleEPlotWriter/SimpleEPlotWriter_UTF8.cpp.

Definition at line 59 of file PropertyContainer.h.

Public Types

typedef DWFStringKeySkipList<
DWFPropertyContainer * > 
tMap
 This type defines a mapped collection of DWFPropertyContainers pointers.

Public Member Functions

typedef _DWFTK_STD_VECTOR (DWFPropertyContainer *) tList
 This type defines a list of DWFPropertyContainer pointers.
_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 DWFProperty::tIteratorgetPropertiesInOrder (const DWFString &zCategory=L"") throw ()
_DWFTK_API size_t getPropertyCount () throw ()
_DWFTK_API size_t getOwnedPropertySetCount () const throw ()
_DWFTK_API size_t getReferencedPropertySetCount () const throw ()
virtual _DWFTK_API void addProperty (DWFProperty *pProperty, bool bOwnProperty) throw ( DWFException )
virtual _DWFTK_API DWFPropertyaddProperty (const DWFString &zName, const DWFString &zValue, const DWFString &zCategory=L"", const DWFString &zType=L"", const DWFString &zUnits=L"") throw ( DWFException )
virtual _DWFTK_API void removeProperty (DWFProperty *pProperty, bool bDeleteIfOwned=true) 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 )
_DWFTK_API bool removeOwnedPropertyContainer (DWFPropertyContainer *pContainer, bool bDelete=true) throw ()
_DWFTK_API bool removeReferencedPropertyContainer (DWFPropertyContainer &rContainer) throw ()
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 )
_DWFTK_API DWFPropertyContainerownedContainer (const DWFString &zID) throw ()
_DWFTK_API DWFPropertyContainerreferencedContainer (const DWFString &zID) throw ()
_DWFTK_API bool ownsContainer (DWFPropertyContainer *pContainer) const throw ()
_DWFTK_API bool referencesContainer (DWFPropertyContainer *pContainer) const throw ()
_DWFTK_API DWFXMLSerializablegetSerializable () const throw ()

Protected Member Functions

virtual _DWFTK_API void identify (const DWFString &zID) throw ()
virtual _DWFTK_API void _serializeXML (DWFXMLSerializer &rSerializer, unsigned int nFlags) throw ( DWFException )
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.
DWFProperty::tList _oOrderedProperties
 This stores the same property pointers as in _oProperties, but it preserves the order of insertion.
DWFPropertyContainer::tList _oContainers
 The collection of sub-containers.
DWFPropertyContainer::tList _oReferences
 The collection of sub-containers that are only referenced by this container.
_Serializer _oSerializer


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::_serializeXML DWFXMLSerializer rSerializer,
unsigned int  nFlags
throw ( DWFException ) [protected, virtual]
 

For internal use only.

This is used to serialize the members of the class. DWFPropertyContainer's private _oSerializer, derived from DWFXMLSerializable, has a serializeXML() method which in turn calls this class's virtual serializeXML. This method maybe redefined in the classes derived from DWFPropertyContainer.

Parameters:
rSerializer The object that accepts the serialization of the object.
nFlags An implementation-defined set of options for altering the serialization process of this object.
Exceptions:
None 

Reimplemented in DWFToolkit::DWFPropertySet.

virtual _DWFTK_API DWFProperty* DWFToolkit::DWFPropertyContainer::addProperty const DWFString zName,
const DWFString zValue,
const DWFString zCategory = L"",
const DWFString zType = L"",
const DWFString zUnits = L""
throw ( DWFException ) [virtual]
 

Create and directly add a property to this container. The container will own the property.

Parameters:
zName Identifies the property within its zCategory.
zValue The data associated with the property.
zCategory An optional grouping of properties.
zType An optional type defining the data.
zUnits An optional type defining the data.
Returns:
A pointer to the created property.
Exceptions:
DWFException 

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 
Examples:
3DPublish/3DPublish_UTF8.cpp, GlobalSectionWriter/GlobalSectionWriter.cpp, SimpleEPlotWriter/SimpleEPlotWriter_UTF8.cpp, and WriteContent/WriteContent.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::DWFPropertySet.

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 its 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 

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.

_DWFTK_API size_t DWFToolkit::DWFPropertyContainer::getOwnedPropertySetCount  )  const throw () [inline]
 

Get the number of directly contained properties sets.

Returns:
The number of property sets directly contained in this property set.
Exceptions:
None 
Since:
7.2.0

Definition at line 186 of file PropertyContainer.h.

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 to 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. This will only return properties directly owned by the container, not in any of the subcontainers or referenced containers.
Exceptions:
None 
Examples:
ReadContentDefinition/ReadContentDefinition.cpp.

virtual _DWFTK_API DWFProperty::tIterator* DWFToolkit::DWFPropertyContainer::getPropertiesInOrder const DWFString zCategory = L""  )  throw () [virtual]
 

Locates all properties in the container that share a category. The iterator returns the properties in the order that they were inserted.

Parameters:
zCategory The property category to search by.
Returns:
A pointer to 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. This will only return properties directly owned by the container, not in any of the subcontainers or referenced containers.
Exceptions:
None 

_DWFTK_API size_t DWFToolkit::DWFPropertyContainer::getPropertyCount  )  throw () [inline]
 

Get the number of directly contained properties.

Returns:
The number of properties directly contained in this property set.
Exceptions:
None 
Since:
7.2.0

Definition at line 171 of file PropertyContainer.h.

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.

_DWFTK_API size_t DWFToolkit::DWFPropertyContainer::getReferencedPropertySetCount  )  const throw () [inline]
 

Get the number of directly referenced properties sets.

Returns:
The number of property sets directly referenced in this property set.
Exceptions:
None 
Since:
7.2.0

Definition at line 201 of file PropertyContainer.h.

_DWFTK_API 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 478 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 

Definition at line 103 of file PropertyContainer.h.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::identify const DWFString zID  )  throw () [inline, protected, virtual]
 

For internal use only.

Assigns a transient UUID. This method is only intended for internal use within serialize() and also during reading of derived classes within parseAttributeList().

Parameters:
zID The UUID to assign.
Exceptions:
None 

Reimplemented in DWFToolkit::DWFPropertySet.

Definition at line 497 of file PropertyContainer.h.

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

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

_DWFTK_API DWFPropertyContainer* DWFToolkit::DWFPropertyContainer::ownedContainer const DWFString zID  )  throw ()
 

Access an owned container by id

Parameters:
zID The id of the container.
Returns:
Pointer to the container if it is found, NULL otherwise.
Since:
7.2.0

_DWFTK_API bool DWFToolkit::DWFPropertyContainer::ownsContainer DWFPropertyContainer pContainer  )  const throw () [inline]
 

This tests whether or not this owns the given property container.

Parameters:
pContainer Pointer to a property container.
Returns:
True if this owns the property container.
Exceptions:
None 

Definition at line 448 of file PropertyContainer.h.

_DWFTK_API DWFPropertyContainer* DWFToolkit::DWFPropertyContainer::referencedContainer const DWFString zID  )  throw ()
 

Access a referenced container by id

Parameters:
zID The id of the container.
Returns:
Pointer to the container if it is found, NULL otherwise.
Since:
7.2.0

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

_DWFTK_API bool DWFToolkit::DWFPropertyContainer::referencesContainer DWFPropertyContainer pContainer  )  const throw () [inline]
 

This tests whether or not this references the given property container.

Parameters:
pContainer Pointer to a property container.
Returns:
True if this refers to the property container.
Exceptions:
None 

Definition at line 462 of file PropertyContainer.h.

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.

_DWFTK_API bool DWFToolkit::DWFPropertyContainer::removeOwnedPropertyContainer DWFPropertyContainer pContainer,
bool  bDelete = true
throw ()
 

Removes from the specified container reference if it is one of the referenced containers.

Parameters:
pContainer The container to remove.
bDelete If true, after removing it from the list delete it.
Returns:
True if the container was found and removed.
Exceptions:
DWFException 
Since:
7.2.0

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.

virtual _DWFTK_API void DWFToolkit::DWFPropertyContainer::removeProperty DWFProperty pProperty,
bool  bDeleteIfOwned = true
throw ( DWFException ) [virtual]
 

Exceptions:
DWFException 

_DWFTK_API bool DWFToolkit::DWFPropertyContainer::removeReferencedPropertyContainer DWFPropertyContainer rContainer  )  throw ()
 

Removes from the specified container reference if it is one of the referenced containers.

Parameters:
rContainer A container reference.
Returns:
True if the container was found and removed.
Exceptions:
DWFException 

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.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:40:37 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5