ContentPresentationNodeContainer.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 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 //  $Header: //DWF/Development/Components/Internal/DWF Toolkit/v7.6/develop/global/src/dwf/presentation/utility/ContentPresentationNodeContainer.h#3 $
00020 //  $DateTime: 2008/12/09 00:24:37 $
00021 //  $Author: gaoje $
00022 //  $Change: 125697 $
00023 
00024 #ifndef _DWFTK_CONTENT_PRESENTATION_NODE_CONTAINER_H
00025 #define _DWFTK_CONTENT_PRESENTATION_NODE_CONTAINER_H
00026 
00027 
00032 
00033 #include "dwfcore/STL.h"
00034 #include "dwfcore/DWFXMLSerializer.h"
00035 #include "dwfcore/Vector.h"
00036 #include "dwfcore/SkipList.h"
00037 using namespace DWFCore;
00038 
00039 #include "dwf/package/XML.h"
00040 #include "dwf/Toolkit.h"
00041 
00042 namespace DWFToolkit
00043 {
00044 
00045 //
00046 // fwd decl
00047 //
00048 class DWFContentPresentationNode;
00049 
00059 class DWFContentPresentationNodeContainer _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE
00060 {
00061 
00062 public:
00063 
00064 public:
00065 
00072     _DWFTK_API
00073     DWFContentPresentationNodeContainer()
00074         throw();
00075 
00083     _DWFTK_API
00084     virtual ~DWFContentPresentationNodeContainer()
00085         throw();
00086 
00095     _DWFTK_API
00096     virtual void addNode( DWFContentPresentationNode* pNode )
00097         throw( DWFException );
00098 
00109     _DWFTK_API
00110     virtual void insertAt( DWFContentPresentationNode* pNode, size_t index )
00111             throw( DWFException );
00112 
00123     _DWFTK_API
00124     virtual DWFOrderedVector<DWFContentPresentationNode*>::Iterator* getNodes( )
00125         throw();
00126 
00135     _DWFTK_API
00136     virtual void removeNode( DWFContentPresentationNode* pNode,
00137                              bool                        bDelete )
00138         throw( DWFException );
00139 
00140 #ifndef DWFTK_READ_ONLY
00141 
00149     DWFXMLSerializable& getSerializable() const
00150         throw()
00151     {
00152         return (DWFXMLSerializable&)_oSerializer;
00153     }
00154 #endif
00155 
00156 #ifndef DWFTK_READ_ONLY
00157 
00158 private:
00159 
00160     //
00161     // in order to avoid bizarre diamond patterns and
00162     // excessively overload base implementations,
00163     // all container classes must define and implementation this
00164     // internal [PRIVATE] class utility for serializing themselves into XML.
00165     //
00166     class _Serializer : public DWFXMLSerializable
00167                         _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00168     {
00169 
00170     public:
00171 
00172         _Serializer()
00173             throw()
00174             : DWFXMLSerializable()
00175             , _pContainer( NULL )
00176         {;}
00177 
00178         virtual ~_Serializer()
00179             throw()
00180         {;}
00181 
00182         void is( DWFContentPresentationNodeContainer* pContainer )
00183         {
00184             _pContainer = pContainer;
00185         }
00186 
00187         //
00188         //
00189         //
00190         virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00191             throw( DWFException );
00192 
00193     private:
00194 
00195         DWFContentPresentationNodeContainer* _pContainer;
00196     };
00197 
00198 private:
00199 
00200     _Serializer _oSerializer;
00201 
00202 #endif
00203 
00204 protected:
00205 
00209     DWFOrderedVector<DWFContentPresentationNode*>      _oNodes;
00210 
00211         typedef DWFStringKeySkipList<size_t>     IDToPostionMap;
00212         IDToPostionMap                                            posMap;
00213 
00214 private:
00215 
00216     DWFContentPresentationNodeContainer( const DWFContentPresentationNodeContainer& );
00217     DWFContentPresentationNodeContainer& operator=( const DWFContentPresentationNodeContainer& );
00218 };
00219 
00220 }
00221 
00222 #endif

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