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

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 it's relationship among other components and detail it's fundamental property interface. Associated instances bind these generializations 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 71 of file DefinedObject.h.

Public Types

typedef vector< DWFDefinedObject * > tList
 This type defines a list of DWFDefinedObject pointers.
typedef DWFWCharKeySkipList<
DWFDefinedObject * > 
tMap
 This type defines a mapped collection of DWFDefinedObject pointers.

Public Member Functions

_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 DWFIterator< DWFString > * getPropertyRefs () throw ()
_DWFTK_API void addPropertyReference (const char *zReferenceID) throw ( DWFException )
_DWFTK_API void addChild (DWFDefinedObject *pChild, uint32_t nGroup=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 multimap< uint32_t,
DWFDefinedObject * > 
_tGroupedChildMap

Protected Attributes

DWFString _zID
vector< DWFString_oPropertyRefs
DWFDefinedObject::tMap _oInstances
_tGroupedChildMap _oChildren


Member Typedef Documentation

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

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

Definition at line 272 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  nGroup = 0
throw ()
 

Add another object as a child.

This is a structural relationship only. No property information is inherited as a result of this association.

Parameters:
pChild The child object. This pointer is now owner by this object and will be deleted with the DWFCORE_FREE_OBJECT macro; as such, it must be allocated with the DWFCORE_ALLOC_OBJECT macro.
nGroup An optional parameter that preserves order relative to the other children. This value does not have to be unique, in fact, it is a group not a key. Groups are sorted in ascending order, so children in group 0 will be published before children in group 1 (or any other group for that matter.) There is no rule defined for child ordering within a group.
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's 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 interator that returns propertys et 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 () [virtual]
 

Returns the ID of the object.

Returns:
The object ID
Exceptions:
None 

Reimplemented from DWFToolkit::DWFPropertyContainer.

_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 

Reimplemented from DWFToolkit::DWFPropertyContainer.

_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]
 

Receives and processes an attribute list from the parser; using it to initialize class members.

Example:

                 size_t iAttrib = 0;
       
                 for(; ppAttributeList[iAttrib]; iAttrib += 2)
                 {
                    //
                    // dump attribute 
                    //
                    cout << "Attribute Name: " << ppAttributeList[iAttrib] << " ";
                    cout << "Attribute Value: " << ppAttributeList[iAttrib+1] << endl;
                }

Parameters:
ppAttributeList An array of null-terminated atribute name, value string pairs. The array itself is zero-terminated.
Exceptions:
None 

Implements DWFToolkit::DWFXMLBuildable.

Reimplemented in DWFToolkit::DWFDefinedObjectInstance.

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

Writes an XML representation of the object into a stream.

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.

Implements DWFToolkit::DWFXMLSerializable.

Reimplemented in DWFToolkit::DWFDefinedObjectInstance.


Member Data Documentation

_tGroupedChildMap DWFToolkit::DWFDefinedObject::_oChildren [protected]
 

The collection of child objects by group.

Definition at line 277 of file DefinedObject.h.

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

A reference collection of the instances created from this objects instance() method.

Definition at line 267 of file DefinedObject.h.

vector<DWFString> DWFToolkit::DWFDefinedObject::_oPropertyRefs [protected]
 

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

Definition at line 261 of file DefinedObject.h.

DWFString DWFToolkit::DWFDefinedObject::_zID [protected]
 

Uniquely identifies the object in the section.

Reimplemented from DWFToolkit::DWFPropertyContainer.

Definition at line 255 of file DefinedObject.h.


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