DWFToolkit::DWFDefinedObject Class Reference
[DWF Package API]

#include "dwf/package/DefinedObject.h"

Inheritance diagram for DWFToolkit::DWFDefinedObject:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

This class is used to represent an object in the DWF package.

Since:
7.0.1
A DWFDefinedObject corresponds to an Object element in an object definition document. A defined object is a documented representation of a design component. These components are completely general and may be characterized as necessary by a publishing application.

A defined object has no corresponding representation in a DWF graphics stream. That role is taken by the DWFDefinedObjectInstance which is, by definition, the association of a specialized, attributed DWFDefinedObject with a graphical element or node. The role of the DWFDefinedObject is to declare the abstract existence of a design component, outline its relationship among other components and detail its fundamental property interface. Associated instances bind these generalizations with visual data and assign and extend their data definitions.

These objects exist in a traditional parent-children hierarchical structure with each other. These are structural relationships only; that is, there is no attribute inheritance between a parent and a child as a result of this relationship.

Examples:

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

Definition at line 199 of file DefinedObject.h.

Public Types

typedef DWFSTDMap< const wchar_t *,
DWFDefinedObject *, tDWFWCharCompareLess
tMap
 This type defines a mapped collection of DWFDefinedObject pointers.
typedef DWFStringVectorIterator<
_DWFTK_STL_ALLOCATOR< DWFString > > 
_tStringVectorIterator
 This type defines a DWFStringVectorIterator with the proper STL allocator.

Public Member Functions

typedef _DWFTK_STD_VECTOR (DWFDefinedObject *) tList
 This type defines a list of DWFDefinedObject pointers.
_DWFTK_API DWFDefinedObject (const DWFString &zID=L"") throw ()
virtual _DWFTK_API ~DWFDefinedObject () throw ()
_DWFTK_API const DWFStringid () const throw ()
_DWFTK_API void identify (const DWFString &zID) throw ()
_DWFTK_API DWFDefinedObjectInstanceinstance (const DWFString &zNode) throw ( DWFException )
_DWFTK_API DWFDefinedObjectInstancegetInstance (const DWFString &zNode) throw ( DWFException )
_DWFTK_API void removeInstance (const DWFString &zNode) throw ( DWFException )
_DWFTK_API DWFIterator< DWFString > * getPropertyRefs () throw ()
_DWFTK_API void addPropertyReference (const char *zReferenceID) throw ( DWFException )
_DWFTK_API void addChild (DWFDefinedObject *pChild, uint32_t nKey=0) throw ()
virtual _DWFTK_API void parseAttributeList (const char **ppAttributeList) throw ( DWFException )
virtual _DWFTK_API void serializeXML (DWFXMLSerializer &rSerializer, unsigned int nFlags) throw ( DWFException )

Protected Types

typedef std::multimap< uint32_t,
DWFDefinedObject * > 
_tGroupedChildMap

Protected Attributes

DWFString _zID
_tStringList _oPropertyRefs
DWFDefinedObject::tMap _oInstances
_tGroupedChildMap _oChildren


Member Typedef Documentation

typedef std::multimap<uint32_t, DWFDefinedObject*> DWFToolkit::DWFDefinedObject::_tGroupedChildMap [protected]
 

Defines the multi-value mapping type used for grouping child objects.

Definition at line 423 of file DefinedObject.h.

typedef DWFSTDMap<const wchar_t*, DWFDefinedObject*, tDWFWCharCompareLess> DWFToolkit::DWFDefinedObject::tMap
 

This type defines a mapped collection of DWFDefinedObject pointers.

Note:
Prior to version 7.3, this had been of type DWFWCharKeySkipList<DWFDefinedObject*>. It was changed to be an STL map for efficiency in large data sets.

Definition at line 220 of file DefinedObject.h.


Constructor & Destructor Documentation

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

Constructor

Parameters:
zID A unique ID for the object. Object IDs should be unique within the section in which they exist.
Exceptions:
None 

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

Destructor

Exceptions:
None 


Member Function Documentation

_DWFTK_API void DWFToolkit::DWFDefinedObject::addChild DWFDefinedObject pChild,
uint32_t  nKey = 0
throw ()
 

Exceptions:
None 

_DWFTK_API void DWFToolkit::DWFDefinedObject::addPropertyReference const char *  zReferenceID  )  throw ( DWFException )
 

Adds a property set reference to the object.

These references are used by the DWFObjectDefinitionReader to quickly process property relationships and defer the resolution until a later time.

Parameters:
zReferenceID The property set reference ID.
Exceptions:
DWFException 
Deprecated:
This legacy API should not be used by new application code. It has been left in until the parsing logic is updated to make DWFPropertyContainer associations without sacrificing performance.

_DWFTK_API DWFDefinedObjectInstance* DWFToolkit::DWFDefinedObject::getInstance const DWFString zNode  )  throw ( DWFException )
 

Looks up the instance of this object "at" a given node.

The instance must have been previously created with instance().

Parameters:
zNode The graphic node identifier.
Returns:
A pointer to the instance. The caller must not delete this pointer as it is owned by another object.
Exceptions:
DWFException 
Warning:
This method will return an invalid pointer if the object was deleted beforehand. As a general rule, this method is useful only during publish-time data creation when it is necessary to look an instance back up after visiting it previously.
Todo:
Provide better ownership tracking.

_DWFTK_API DWFIterator<DWFString>* DWFToolkit::DWFDefinedObject::getPropertyRefs  )  throw ()
 

Returns a list of property set reference identifiers.

These references are assembled during parsing of an object definition document. They are temporary links that are used by the DWFObjectDefinition to build the complete list of instance properties.

Returns:
A pointer to an iterator that returns property set reference IDs. This pointer must be deleted with the DWFCORE_FREE_OBJECT macro.
Exceptions:
None 
Deprecated:
This legacy API should not be used by new application code. It has been left in until the property reference logic is merged into the DWFPropertyContainer construct.
Todo:
Remove string-referenced property set references in favor of DWFPropertyContainer implementation.

_DWFTK_API const DWFString& DWFToolkit::DWFDefinedObject::id  )  const throw ()
 

Returns the ID of the object.

Returns:
The object ID
Exceptions:
None 

_DWFTK_API void DWFToolkit::DWFDefinedObject::identify const DWFString zID  )  throw ()
 

Assigns an ID to the object.

Object IDs should be unique within the section in which they exist.

Parameters:
zID The object ID.
Exceptions:
None 

_DWFTK_API DWFDefinedObjectInstance* DWFToolkit::DWFDefinedObject::instance const DWFString zNode  )  throw ( DWFException )
 

Creates a new instance of this object "at" a given node in a graphics stream.

Each new instance created by this method is tracked and can be recovered by calling getInstance().

Parameters:
zNode The graphics node identifier.
Returns:
A pointer to the new instance. The caller must release this pointer with the DWFCORE_FREE_OBJECT macro.
Exceptions:
DWFException 
Examples:
SimpleEPlotWriter/SimpleEPlotWriter_UTF8.cpp.

virtual _DWFTK_API void DWFToolkit::DWFDefinedObject::parseAttributeList const char **  ppAttributeList  )  throw ( DWFException ) [virtual]
 

Implements DWFCore::DWFXMLBuildable.

_DWFTK_API void DWFToolkit::DWFDefinedObject::removeInstance const DWFString zNode  )  throw ( DWFException )
 

Removes the given instance from our instance tracking collection.

The instance must have been previously created with instance().

Ownership of the instance passes to the caller, who must release this object with the DWFCORE_FREE_OBJECT macro.

Parameters:
zNode The graphic node identifier.
Exceptions:
DWFException 
Since:
7.2.0
Todo:
Provide better ownership tracking.

virtual _DWFTK_API void DWFToolkit::DWFDefinedObject::serializeXML DWFXMLSerializer rSerializer,
unsigned int  nFlags
throw ( DWFException ) [virtual]
 

Implements DWFCore::DWFXMLSerializableBase.


Member Data Documentation

_tGroupedChildMap DWFToolkit::DWFDefinedObject::_oChildren [protected]
 

The collection of child objects by group.

Definition at line 428 of file DefinedObject.h.

DWFDefinedObject::tMap DWFToolkit::DWFDefinedObject::_oInstances [protected]
 

A reference collection of the instances created from this object's instance() method.

Definition at line 418 of file DefinedObject.h.

_tStringList DWFToolkit::DWFDefinedObject::_oPropertyRefs [protected]
 

A collection of property set references built up from the DWFObjectDefinitionReader processor.

Definition at line 412 of file DefinedObject.h.

DWFString DWFToolkit::DWFDefinedObject::_zID [protected]
 

Uniquely identifies the object in the section.

Definition at line 405 of file DefinedObject.h.


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