Group.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/Group.h#2 $
00019 //  $DateTime: 2008/06/18 18:08:14 $
00020 //  $Author: gaoje $
00021 //  $Change: 101166 $
00022 //  $Revision: #2 $
00023 //
00024 
00025 #ifndef _DWFTK_GROUP_H
00026 #define _DWFTK_GROUP_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 DWFGroup : 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<DWFGroup*>             tList;
00074     typedef DWFStringKeySkipList<DWFGroup*>         tMap;
00079     typedef DWFCachingIterator<DWFGroup*>           tCachingIterator;
00083     typedef DWFIterator<DWFGroup*>                  tIterator;
00084 
00089     typedef enum teUnresolvedAttributes
00090     {
00091         //
00092         ePropertySetReferences    = DWFPropertySet::ePropertySetReferences,
00093 
00094         //
00095         eContentElementReferences = DWFPropertySet::ePropertySetReferences + 1
00096 
00097     } teUnresolvedAttributes;
00098 
00099 public:
00100 
00106     _DWFTK_API
00107     virtual ~DWFGroup()
00108         throw();
00109 
00117     _DWFTK_API
00118     DWFContentElement::tList::Iterator* getElements()
00119         throw()
00120     {
00121         return (_oContentElements.size() > 0 ? _oContentElements.iterator() : NULL);
00122     }
00123 
00130     _DWFTK_API
00131     size_t getElementCount() const
00132         throw()
00133     {
00134         return _oContentElements.size();
00135     }
00136 
00144     _DWFTK_API
00145     bool hasElement( DWFContentElement* pElement ) const
00146         throw()
00147     {
00148         size_t iLocation;
00149         return _oContentElements.findFirst( pElement, iLocation );
00150     } 
00151 
00155     _DWFTK_API
00156     virtual void parseAttributeList( const char** ppAttributeList,
00157                                      tUnresolvedList& rUnresolved )
00158         throw( DWFException );
00159 
00160 protected:
00161 
00173     _DWFTK_API
00174     DWFGroup( const DWFString& zID = /*NOXLATE*/L"",
00175               DWFContent* pContent = NULL )
00176         throw();
00177 
00178 #ifndef DWFTK_READ_ONLY
00179 
00183     _DWFTK_API
00184     virtual void _serializeAttributes( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00185         throw( DWFException );
00186 
00190     _DWFTK_API
00191     virtual void _serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00192         throw( DWFException );
00193 
00194 #endif
00195 
00196 private:
00197 
00204     _DWFTK_API
00205     void _addElement( DWFContentElement* pElement )
00206         throw()
00207     {
00208         _oContentElements.push_back( pElement );
00209     }
00210 
00218     _DWFTK_API
00219     bool _removeElement( DWFContentElement* pElement )
00220         throw()
00221     {
00222         return _oContentElements.erase( pElement );
00223     }
00224 
00230     _DWFTK_API
00231     void _removeElements()
00232         throw()
00233     {
00234         _oContentElements.clear();
00235     }
00236 
00237 private:
00238 
00239     DWFContentElement::tList        _oContentElements;
00240 
00241 private:
00242 
00243     DWFGroup( const DWFGroup& );
00244     DWFGroup& operator=( const DWFGroup& );
00245 
00246 };
00247 
00248 }
00249 
00250 #endif

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