ObjectDefinition.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2006 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_OBJECT_DEFINITION_H
00021 #define _DWFTK_OBJECT_DEFINITION_H
00022 
00023 
00028 
00029 
00030 #include "dwfcore/STL.h"
00031 
00032 #include "dwf/Toolkit.h"
00033 #include "dwf/package/reader/ObjectDefinitionReader.h"
00034 #include "dwf/package/utility/PropertyContainer.h"
00035 
00036 namespace DWFToolkit
00037 {
00038 
00050 class DWFObjectDefinition : public DWFObjectDefinitionReader
00051                             _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00052 {
00053 public:
00054     typedef _DWFTK_STD_VECTOR(DWFString) tStringVector;
00055 
00056 public:
00057 
00070     _DWFTK_API
00071     DWFObjectDefinition( DWFPackageReader* pPackageReader )
00072         throw();
00073 
00079     _DWFTK_API
00080     virtual ~DWFObjectDefinition()
00081         throw();
00082 
00093     _DWFTK_API
00094     void getRootInstances( DWFDefinedObjectInstance::tList& rRootInstances )
00095         throw( DWFException );
00096 
00123     _DWFTK_API
00124     DWFPropertyContainer* getInstanceProperties( DWFDefinedObjectInstance& rInstance,
00125                                                      DWFPropertyContainer* pContainer = NULL )
00126         throw( DWFException );
00127 
00151     _DWFTK_API
00152     DWFPropertyContainer* getInstanceProperties( const DWFString& zInstanceID )
00153         throw( DWFException );
00154 
00167     _DWFTK_API
00168     DWFPropertyContainer& getCachedInstanceProperties( const DWFString& zInstanceID )
00169         throw( DWFException );
00170 
00177     _DWFTK_API
00178     double version() const
00179         throw()
00180     {
00181         return _nVersion;
00182     }
00183 
00187     _DWFTK_API
00188     double provideVersion( double nVersion )
00189         throw();
00190 
00194     _DWFTK_API
00195     void provideProperties( const DWFString&    zID,
00196                             tStringVector*  pPropertyRefs,
00197                             DWFProperty::tList* pPropertyList )
00198         throw();
00199 
00203     _DWFTK_API
00204     DWFDefinedObject* provideObject( DWFDefinedObject* pObject )
00205         throw();
00206 
00210     _DWFTK_API
00211     DWFDefinedObjectInstance* provideInstance( DWFDefinedObjectInstance* pInstance )
00212         throw();
00213 
00214 private:
00215 
00216     typedef struct _tPropertySet
00217     {
00218         DWFProperty::tList*                 pList;
00219 
00220         typedef _DWFTK_STD_VECTOR(struct _tPropertySet*) tList;
00221         tList  oRefs;
00222     } tPropertySet;
00223 
00224     typedef DWFStringKeySkipList<tPropertySet*> tPropertySetMap;
00225 
00226 
00227 private:
00228 
00229     //
00230     //
00231     //
00232     void _resolvePropertyRefs( tPropertySet*         pSet,
00233                                DWFPropertyContainer* pContainer )
00234         throw();
00235 
00236 protected:
00237 
00238     double                          _nVersion;
00239 
00240     tPropertySetMap                 _oPropertySets;
00241     DWFDefinedObject::tMap          _oObjects;
00242     DWFDefinedObjectInstance::tMap  _oInstances;
00243 
00244         typedef _DWFTK_STD_MAP_COMP(const wchar_t*, DWFPropertyContainer*, tDWFWCharCompareLess) tCache;
00245         tCache _oCache;
00246 
00247 };
00248 
00249 
00250 }
00251 
00252 #endif

Generated on Tue Jan 6 22:40:04 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5