Class.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 2005-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/package/Class.h#2 $
00019 //  $DateTime: 2008/06/18 18:08:14 $
00020 //  $Author: gaoje $
00021 //  $Change: 101166 $
00022 //  $Revision: #2 $
00023 //
00024 
00025 #ifndef _DWFTK_CLASS_H
00026 #define _DWFTK_CLASS_H
00027 
00032 
00033 #include "dwfcore/STL.h"
00034 
00035 #include "dwf/Toolkit.h"
00036 #include "dwf/package/ContentElement.h"
00037 
00038 namespace DWFToolkit
00039 {
00040 
00052 class DWFClass : public DWFContentElement
00053                _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00054 {
00055 
00056     //
00057     // Management of this class will occur only through the content class
00058     //
00059     friend class DWFContent;
00060     //
00061     // During reading, the DWFXMLElementBuilder needs to create these classes
00062     //
00063     friend class DWFXMLElementBuilder;
00064 
00065 public:
00066 
00070     typedef DWFOrderedVector<DWFClass*>             tList;
00074     typedef DWFStringKeySkipList<DWFClass*>         tMap;
00079     typedef DWFCachingIterator<DWFClass*>           tCachingIterator;
00083     typedef DWFIterator<DWFClass*>                  tIterator;
00084 
00089     typedef enum teUnresolvedAttributes
00090     {
00091         //
00092         ePropertySetReferences  = DWFPropertySet::ePropertySetReferences,
00093 
00094         //
00095         eBaseClassReferences    = DWFPropertySet::ePropertySetReferences + 1
00096 
00097     } teUnresolvedAttributes;
00098 
00099 public:
00100 
00106     _DWFTK_API
00107     virtual ~DWFClass()
00108         throw();
00109 
00117     _DWFTK_API
00118     DWFClass::tList::Iterator* getBaseClasses() 
00119         throw()
00120     {
00121         return (_oBaseClasses.size() > 0 ? _oBaseClasses.iterator() : NULL);
00122     }
00123 
00130     _DWFTK_API
00131     size_t getBaseClassCount() const
00132         throw()
00133     {
00134         return _oBaseClasses.size();
00135     }
00136 
00144     _DWFTK_API
00145     bool isBaseClass( DWFClass* pClass ) const
00146         throw()
00147     {
00148         size_t iLocation;
00149         return _oBaseClasses.findFirst( pClass, iLocation );
00150     }   
00151 
00155     _DWFTK_API
00156     virtual void parseAttributeList( const char** ppAttributeList,
00157                                      tUnresolvedList& rUnresolved )
00158         throw( DWFException );
00159 
00160 protected:
00161 
00172     _DWFTK_API
00173     DWFClass( const DWFString& zID = /*NOXLATE*/L"",
00174               DWFContent* pContent = NULL )
00175         throw();
00176 
00177 #ifndef DWFTK_READ_ONLY
00178 
00182     _DWFTK_API
00183     virtual void _serializeAttributes( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00184         throw( DWFException );
00185 
00189     _DWFTK_API
00190     virtual void _serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00191         throw( DWFException );
00192 
00193 #endif
00194 
00198     _DWFTK_API
00199     virtual void insertPropertyAncestors( DWFContentElement::tVector& rAncestorElements ) const
00200         throw();
00201 
00202 private:
00203 
00211     _DWFTK_API
00212     void _addBaseClass( DWFClass* pBaseClass )
00213         throw()
00214     {
00215         _oBaseClasses.push_back( pBaseClass );
00216     }
00217 
00225     _DWFTK_API
00226     bool _removeBaseClass( DWFClass* pBaseClass )
00227         throw()
00228     {
00229         return _oBaseClasses.erase( pBaseClass );
00230     }
00231 
00237     _DWFTK_API
00238     void _removeBaseClasses()
00239         throw()
00240     {
00241         _oBaseClasses.clear();
00242     }
00243 
00244 private:
00245 
00246     DWFClass::tList        _oBaseClasses;
00247 
00248 private:
00249 
00250     DWFClass( const DWFClass& );
00251     DWFClass& operator=( const DWFClass& );
00252 };
00253 
00254 }
00255 
00256 #endif
00257 

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