ObjectDefinitionResource.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_RESOURCE_H
00021 #define _DWFTK_OBJECT_DEFINITION_RESOURCE_H
00022 
00023 
00028 
00029 
00030 #include "dwf/Toolkit.h"
00031 #include "dwf/package/Resource.h"
00032 #include "dwf/package/utility/DefinedObjectContainer.h"
00033 
00034 
00035 namespace DWFToolkit
00036 {
00037 
00056 class DWFObjectDefinitionResource : public DWFResource
00057                                   , public DWFDefinedObjectContainer
00058                                   , public DWFDefinedObjectInstanceContainer
00059                                   _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00060 {
00061 
00062 public:
00063 
00080     _DWFTK_API
00081     DWFObjectDefinitionResource( const DWFString& zType,
00082                                  const DWFString& zRole )
00083         throw();
00084 
00090     _DWFTK_API
00091     virtual ~DWFObjectDefinitionResource()
00092         throw();
00093 
00094 
00095 #ifndef DWFTK_READ_ONLY
00096 
00097     //
00098     // Returns a stream for reading the resource data
00099     // The caller is responsible for releasing the pointer
00100     // with the \b DWFCORE_FREE_OBJECT macro.
00101     // 
00102     // This resource object is a bit special since it's created
00103     // on-demand when a section with defined objects is serialized.
00104     // This method is overridden in order to provide a real byte stream
00105     // for the package writer to use to create the object defintion document
00106     //
00107     // bCache is ignored
00108 
00125     _DWFTK_API
00126     virtual DWFInputStream* getInputStream( bool bCache = false )
00127         throw( DWFException );
00128 
00132     _DWFTK_API
00133     const DWFXMLNamespace& addNamespace( const DWFString& zNamespace, 
00134                                          const DWFString& zXMLNS )
00135         throw( DWFException );
00136 
00140     _DWFTK_API
00141     void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00142         throw( DWFException );
00143 
00144 private:
00145 
00146     typedef std::map<DWFString, DWFXMLNamespace> _tNamespaceMap;
00147     _tNamespaceMap                               _oAddedNamespaces;
00148 
00149 #endif
00150 
00151 private:
00152 
00153     DWFString   _zType;
00154     char*       _pBuffer;
00155 
00156 private:
00157 
00158     DWFObjectDefinitionResource( const DWFObjectDefinitionResource& );
00159     DWFObjectDefinitionResource& operator=( const DWFObjectDefinitionResource& );
00160 };
00161 
00162 
00163 }
00164 
00165 #endif

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