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

DefinedObject.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2005 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 
00019 
00020 #ifndef _DWFTK_DEFINED_OBJECT_H
00021 #define _DWFTK_DEFINED_OBJECT_H
00022 
00027 
00028 
00029 #include "dwfcore/STL.h"
00030 #include "dwfcore/SkipList.h"
00031 using namespace DWFCore;
00032 
00033 #include "dwf/Toolkit.h"
00034 #include "dwf/package/XML.h"
00035 #include "dwf/package/reader/PackageReader.h"
00036 #include "dwf/package/utility/PropertyContainer.h"
00037 
00038 namespace DWFToolkit
00039 {
00040 
00041 //
00042 // fwd decl
00043 //
00044 class DWFDefinedObjectInstance;
00045 
00046 
00047 
00071 class DWFDefinedObject : public DWFXMLBuildable
00072 
00073 #ifndef DWFTK_READ_ONLY
00074                        , public DWFXMLSerializable
00075 #endif
00076                        , public DWFPropertyContainer
00077 {
00078 
00079 public:
00080 
00084     typedef vector<DWFDefinedObject*>               tList;
00085 
00089     typedef DWFWCharKeySkipList<DWFDefinedObject*>  tMap;
00090 
00091 public:
00092 
00100     _DWFTK_API
00101     DWFDefinedObject( const DWFString& zID = L"" )
00102         throw();
00103 
00109     _DWFTK_API
00110     virtual ~DWFDefinedObject()
00111         throw();
00112 
00119     _DWFTK_API
00120     const DWFString& id() const
00121         throw();
00122 
00130     _DWFTK_API
00131     void identify( const DWFString& zID )
00132         throw();
00133 
00145     _DWFTK_API
00146     DWFDefinedObjectInstance* instance( const DWFString& zNode )
00147         throw( DWFException );
00148 
00166     _DWFTK_API
00167     DWFDefinedObjectInstance* getInstance( const DWFString& zNode )
00168         throw( DWFException );
00169 
00187     _DWFTK_API
00188     DWFIterator<DWFString>* getPropertyRefs()
00189         throw();
00190 
00206     _DWFTK_API
00207     void addPropertyReference( const char* zReferenceID )
00208         throw( DWFException );
00209 
00228     _DWFTK_API
00229     void addChild( DWFDefinedObject* pChild, uint32_t nGroup = 0 )
00230         throw();
00231 
00235     _DWFTK_API
00236     virtual void parseAttributeList( const char** ppAttributeList )
00237         throw( DWFException );
00238 
00239 #ifndef DWFTK_READ_ONLY
00240 
00244     _DWFTK_API
00245     virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00246         throw( DWFException );
00247 
00248 #endif
00249 
00250 protected:
00251 
00255     DWFString               _zID;
00256 
00261     vector<DWFString>       _oPropertyRefs;
00262 
00267     DWFDefinedObject::tMap  _oInstances;
00268 
00272     typedef multimap<uint32_t, DWFDefinedObject*>   _tGroupedChildMap;
00273 
00277     _tGroupedChildMap       _oChildren;
00278 
00279 private:
00280 
00281     DWFDefinedObject( const DWFDefinedObject& );
00282     DWFDefinedObject& operator=( const DWFDefinedObject& );
00283 };
00284 
00305 class DWFDefinedObjectInstance : public DWFDefinedObject
00306 {
00307 
00308 public:
00309 
00313     typedef vector<DWFDefinedObjectInstance*>               tList;
00317     typedef DWFWCharKeySkipList<DWFDefinedObjectInstance*>  tMap;
00318 
00319 public:
00320 
00327     _DWFTK_API
00328     DWFDefinedObjectInstance( unsigned long nSequence )
00329         throw();
00330 
00338     _DWFTK_API
00339     DWFDefinedObjectInstance( DWFDefinedObject& rObject,
00340                               const DWFString&  zNode )
00341         throw();
00342 
00348     _DWFTK_API
00349     virtual ~DWFDefinedObjectInstance()
00350         throw();
00351 
00358     _DWFTK_API
00359     const DWFString& node() const
00360         throw();
00361 
00368     _DWFTK_API
00369     const DWFString& object() const
00370         throw();
00371 
00378     _DWFTK_API
00379     unsigned long sequence() const
00380         throw();
00381 
00390     _DWFTK_API
00391     DWFIterator<DWFString>* children()
00392         throw();
00393 
00412     _DWFTK_API
00413     void addChild( DWFDefinedObjectInstance* pChild, uint32_t nGroup = 0 )
00414         throw();
00415 
00424     _DWFTK_API
00425     void resolveObject( DWFDefinedObject* pObject )
00426         throw();
00427 
00435     _DWFTK_API
00436     void resolveChild( DWFDefinedObjectInstance* pInstance )
00437         throw();
00438 
00446     _DWFTK_API
00447     void resolveParent( DWFDefinedObjectInstance* pInstance )
00448         throw();
00449 
00458     _DWFTK_API
00459     DWFDefinedObject* resolvedObject() const
00460         throw();
00461 
00470     _DWFTK_API
00471     DWFDefinedObjectInstance* resolvedParent() const
00472         throw();
00473 
00484     _DWFTK_API
00485     DWFDefinedObjectInstance::tMap::Iterator* resolvedChildren()
00486         throw();
00487 
00491     _DWFTK_API
00492     virtual void parseAttributeList( const char** ppAttributeList )
00493         throw( DWFException );
00494 
00495 #ifndef DWFTK_READ_ONLY
00496 
00500     _DWFTK_API
00501     virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00502         throw( DWFException );
00503 
00504 #endif
00505 
00506 private:
00507 
00508     unsigned long       _nSequence;
00509 
00510     DWFString           _zNode;
00511     DWFString           _zObject;
00512     vector<DWFString>   _oChildIDs;
00513 
00514     typedef multimap<uint32_t, DWFDefinedObjectInstance*>   _tGroupedChildMap;
00515     _tGroupedChildMap       _oChildren;
00516 
00517     DWFDefinedObject*                       _pResolvedObject;
00518     DWFDefinedObjectInstance*               _pResolvedParent;
00519     DWFDefinedObjectInstance::tMap          _oResolvedChildren;
00520 
00521 private:
00522 
00523     DWFDefinedObjectInstance( const DWFDefinedObjectInstance& );
00524     DWFDefinedObjectInstance& operator=( const DWFDefinedObjectInstance& );
00525 };
00526 
00527 
00528 
00529 }
00530 
00531 #endif

Generated on Tue May 17 12:38:50 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1