PublishedDefinedObject.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 //  $Header: //DWF/Development/Components/Internal/DWF Toolkit/v7.6/develop/global/src/dwf/publisher/impl/PublishedDefinedObject.h#3 $
00019 //  $DateTime: 2008/10/23 01:05:47 $
00020 //  $Author: gaoje $
00021 //  $Change: 118604 $
00022 //  $Revision: #3 $
00023 //
00024 
00025 #ifndef _DWFTK_PUBLISHED_DEFINED_OBJECT_H
00026 #define _DWFTK_PUBLISHED_DEFINED_OBJECT_H
00027 
00028 
00033 
00034 #ifndef DWFTK_READ_ONLY
00035 
00036 #include "dwf/publisher/PublishedObject.h"
00037 #include "dwf/package/ObjectDefinitionResource.h"
00038 
00039 namespace DWFToolkit
00040 {
00041 
00051 class DWFPublishedDefinedObject : public DWFPublishedObject
00052                                   _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00053 {
00054 
00055 public:
00056 
00060     typedef DWFPublishedObject::tKey                                            tKey;
00064     typedef _DWFTK_STD_VECTOR(DWFPublishedDefinedObject*)                       tList;
00068     typedef DWFSkipList<DWFPublishedObject::tKey, DWFPublishedDefinedObject*>   tMap;
00069 
00070 public:
00071 
00082     class Factory : public DWFPublishedObject::Factory
00083                     _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00084     {
00085 
00086     public:
00087 
00093         _DWFTK_API
00094         Factory()
00095             throw();
00096 
00102         _DWFTK_API
00103         virtual ~Factory()
00104             throw();
00105 
00114         _DWFTK_API
00115         virtual DWFPublishedObject* makePublishedObject( DWFPublishedObject::tKey nKey,
00116                                                          const DWFString&         zName )
00117             throw( DWFException );
00118 
00126         _DWFTK_API
00127         virtual DWFPublishedObject& findPublishedObject( DWFPublishedObject::tKey nKey )
00128             throw( DWFException );
00129 
00136         _DWFTK_API
00137         DWFPublishedDefinedObject::tMap::Iterator* getPublishedObjects()
00138             throw()
00139         {
00140             return _oPublishedObjects.iterator();
00141         }
00142 
00143     private:
00144 
00145         DWFPublishedDefinedObject::tMap        _oPublishedObjects;
00146 
00147     private:
00148 
00149         //
00150         //  Not implemented
00151         //
00152         Factory( const Factory& );
00153         Factory& operator=( const Factory& );
00154 
00155     };
00156 
00157 public:
00158 
00170     class Visitor : public DWFPublishedObject::Visitor
00171                     _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00172     {
00173 
00174     public:
00175 
00179         static const wchar_t* const kz_PropName_Published_Object;
00183         static const wchar_t* const kz_PropCategory_Hidden;
00184 
00185     public:
00186 
00192         _DWFTK_API
00193         Visitor()
00194             throw( DWFException );
00195 
00201         _DWFTK_API
00202         virtual ~Visitor()
00203             throw()
00204         {;}
00205 
00211         _DWFTK_API
00212         void setObjectDefinitionResource( DWFObjectDefinitionResource* pObjectDefinition )
00213         {
00214             _pObjectDefinition = pObjectDefinition;
00215         }
00216 
00223         _DWFTK_API
00224         DWFObjectDefinitionResource* getObjectDefinitionResource() const
00225         {
00226             return _pObjectDefinition;
00227         }
00228 
00235                 _DWFTK_API
00236                         void setReferencedObjectDefinitionResource( DWFObjectDefinitionResource* pReferencedObjectDefinition )
00237                 {
00238                         _pReferencedObjectDefinition = pReferencedObjectDefinition;
00239                 }
00240 
00248                 _DWFTK_API
00249                         DWFObjectDefinitionResource* getReferencedObjectDefinitionResource() const
00250                 {
00251                         return _pReferencedObjectDefinition;
00252                 }
00253 
00257         _DWFTK_API
00258         void visitPublishedObject( DWFPublishedObject& rObject )
00259             throw( DWFException );
00260 
00261     private:
00262 
00263         _DWFTK_API
00264         void _definePublishedObject( DWFPublishedObject&        rPublishedObject,
00265                                      DWFDefinedObject**         ppDefinedObject,
00266                                      DWFDefinedObjectInstance** ppDefinedInstance )
00267             throw( DWFException );
00268 
00269         _DWFTK_API
00270         DWFDefinedObject* _findDefinedObject( DWFPublishedObject& rPublishedObject ) const
00271             throw();
00272 
00273     private:
00274 
00275         DWFObjectDefinitionResource*    _pObjectDefinition;
00276 
00277                 // This is used to collect the instances not be handled by _pObjectDefinition.
00278                 DWFObjectDefinitionResource*    _pReferencedObjectDefinition;
00279 
00280         unsigned int                    _nNextInstanceID;
00281 
00282     };
00283 
00284 public:
00285 
00293     _DWFTK_API
00294     DWFPublishedDefinedObject( tKey             nKey,
00295                                const DWFString& zName )
00296         throw();
00297 
00303     _DWFTK_API
00304     virtual ~DWFPublishedDefinedObject()
00305         throw();
00306 
00310     _DWFTK_API
00311     virtual void addPropertyContainer( DWFPropertyContainer* pContainer )
00312         throw( DWFException );
00313 
00317     _DWFTK_API
00318     virtual void referencePropertyContainer( const DWFPropertyContainer& rContainer )
00319         throw( DWFException );
00320 
00321 };
00322 
00323 //
00324 // required for win32 dll external linkage
00325 //
00326 #ifdef  _DWFCORE_WIN32_SYSTEM
00327 #ifndef DWFTK_STATIC
00328 
00329 //DNT_Start
00330 _declspec(selectany) const wchar_t* const DWFPublishedDefinedObject::Visitor::kz_PropName_Published_Object =    L"_name";
00331 _declspec(selectany) const wchar_t* const DWFPublishedDefinedObject::Visitor::kz_PropCategory_Hidden =          L"hidden";
00332 //DNT_End
00333 
00334 #endif
00335 #endif
00336 
00337 }
00338 
00339 #endif
00340 #endif

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