Feature.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/Feature.h#2 $
00019 //  $DateTime: 2008/06/18 18:08:14 $
00020 //  $Author: gaoje $
00021 //  $Change: 101166 $
00022 //
00023 
00024 #ifndef _DWFTK_FEATURE_H
00025 #define _DWFTK_FEATURE_H
00026 
00031 
00032 #include "dwfcore/STL.h"
00033 
00034 #include "dwf/Toolkit.h"
00035 #include "dwf/package/Class.h"
00036 #include "dwf/package/Renderable.h"
00037 
00038 namespace DWFToolkit
00039 {
00040 
00041 
00055 class DWFFeature : public DWFRenderable
00056                  _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00057 {
00058 
00059     //
00060     // Management of this class will occur only through the content class
00061     //
00062     friend class DWFContent;
00063     //
00064     // During reading, the DWFXMLElementBuilder needs to create these classes
00065     //
00066     friend class DWFXMLElementBuilder;
00067 
00068 public:
00069 
00073     typedef DWFOrderedVector<DWFFeature*>           tList;
00077     typedef DWFStringKeySkipList<DWFFeature*>       tMap;
00082     typedef DWFCachingIterator<DWFFeature*>         tCachingIterator;
00086     typedef DWFIterator<DWFFeature*>                tIterator;
00087 
00092     typedef enum teUnresolvedAttributes
00093     {
00094         //
00095         ePropertySetReferences  = DWFPropertySet::ePropertySetReferences,
00096 
00097         //
00098         eClassReferences        = DWFPropertySet::ePropertySetReferences + 1
00099 
00100     };
00101 
00102 public:
00103 
00109     _DWFTK_API
00110     virtual ~DWFFeature()
00111         throw();
00112 
00120     _DWFTK_API
00121     DWFClass::tList::Iterator* getClasses()
00122         throw()
00123     {
00124         return (_oClasses.size() > 0 ? _oClasses.iterator() : NULL);
00125     }
00126 
00133     _DWFTK_API
00134     size_t getClassCount() const
00135         throw()
00136     {
00137         return _oClasses.size();
00138     }
00139 
00147     _DWFTK_API
00148     bool hasClass( DWFClass* pClass ) const
00149         throw()
00150     {
00151         size_t iLocation;
00152         return _oClasses.findFirst( pClass, iLocation );
00153     } 
00154 
00158     _DWFTK_API
00159     virtual void parseAttributeList( const char** ppAttributeList,
00160                                      tUnresolvedList& rUnresolved )
00161         throw( DWFException );
00162 
00163 protected:
00164 
00175     _DWFTK_API
00176     DWFFeature( const DWFString& zID = /*NOXLATE*/L"",
00177                 DWFContent* pContent = NULL )
00178         throw();
00179 
00180 #ifndef DWFTK_READ_ONLY
00181 
00185     _DWFTK_API
00186     virtual void _serializeAttributes( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00187         throw( DWFException );
00188 
00192     _DWFTK_API
00193     virtual void _serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00194         throw( DWFException );
00195 
00196 #endif
00197 
00201     _DWFTK_API
00202     virtual void insertPropertyAncestors( DWFContentElement::tVector& rAncestorElements ) const
00203         throw();
00204 
00205 private:
00206 
00213     _DWFTK_API
00214     void _addClass( DWFClass* pClass )
00215         throw()
00216     {
00217         _oClasses.push_back( pClass );
00218     }
00219 
00227     _DWFTK_API
00228     bool _removeClass( DWFClass* pClass )
00229         throw()
00230     {
00231         return _oClasses.erase( pClass );
00232     }
00233 
00239     _DWFTK_API
00240     void _removeClasses()
00241         throw()
00242     {
00243         _oClasses.clear();
00244     }
00245 
00246 private:
00247 
00248     // References (pointers) to classes that classify this entity.
00249     DWFClass::tList    _oClasses;
00250 
00251 private:
00252 
00253     //
00254     // Not Implemented
00255     //
00256     DWFFeature( const DWFFeature& );
00257     DWFFeature& operator=( const DWFFeature& );
00258 
00259 };
00260 
00261 }
00262 
00263 #endif
00264 

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