Part.h

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 //  $Header: //DWF/Development/Components/Internal/DWF Toolkit/v7.6/develop/global/src/dwf/opc/Part.h#2 $
00019 //  $DateTime: 2008/06/18 18:08:14 $
00020 //  $Author: gaoje $
00021 //  $Change: 101166 $
00022 //  $Revision: #2 $
00023 //
00024 //
00025 
00026 #ifndef _DWFTK_OPCPART_H
00027 #define _DWFTK_OPCPART_H
00028 
00029 #include "dwfcore/Owner.h"
00030 #include "dwfcore/InputStream.h"
00031 using namespace DWFCore;
00032 
00033 #include "dwf/opc/RelationshipContainerInterface.h"
00034 
00035 namespace DWFToolkit
00036 {
00037 
00038 //
00039 //  fwd declarations
00040 //
00041 class OPCRelationshipContainer;
00042 
00053 class OPCPart : public OPCRelationshipContainerInterface
00054               , public DWFOwnable
00055               _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00056 {
00057 
00058 public:
00059 
00063     typedef DWFOrderedVector<OPCPart*>              tList;
00067     typedef DWFStringKeySkipList<OPCPart*>          tMap;
00072     typedef DWFCachingIterator<OPCPart*>            tCachingIterator;
00076     typedef DWFIterator<OPCPart*>                   tIterator;
00077 
00078 public:
00079 
00085     _DWFTK_API
00086     OPCPart()
00087         throw();
00088 
00094     _DWFTK_API
00095     virtual ~OPCPart()
00096         throw();
00097 
00106     _DWFTK_API
00107     virtual void setPath( const DWFString& zPath )
00108         throw()
00109     {
00110         _zPath = zPath;
00111     }
00112 
00123     _DWFTK_API
00124     virtual void setName( const DWFString& zName )
00125         throw( DWFException );
00126 
00133     _DWFTK_API
00134     virtual const DWFString& path() const
00135         throw()
00136     {
00137         return _zPath;
00138     }
00139 
00146     _DWFTK_API
00147     virtual const DWFString& name() const
00148         throw()
00149     {
00150         return _zName;
00151     }
00152 
00159     _DWFTK_API
00160     virtual DWFString uri() const
00161         throw( DWFException );
00162 
00172     _DWFTK_API
00173     virtual DWFString relationshipUri() const
00174         throw( DWFException );
00175 
00176     _DWFTK_API
00177     virtual OPCRelationship* addRelationship( OPCPart* pTargetPart, 
00178                                               const DWFString& zRelationshipType, 
00179                                               OPCRelationship::teTargetMode eTargetMode = OPCRelationship::eInternal )
00180         throw( DWFException );
00181 
00182     _DWFTK_API
00183     virtual bool deleteRelationship( OPCRelationship* pRelationship )
00184         throw();
00185 
00186     _DWFTK_API
00187     virtual size_t relationshipCount() const
00188         throw();
00189 
00190     _DWFTK_API
00191     virtual OPCRelationship::tIterator* relationships()
00192         throw();
00193 
00194     _DWFTK_API
00195     virtual OPCRelationship::tIterator* relationshipsByTarget( const DWFString& zTargetURI ) const
00196         throw();
00197 
00198     _DWFTK_API
00199     virtual OPCRelationship::tIterator* relationshipsByTarget( OPCPart* ) const
00200         throw();
00201 
00202     _DWFTK_API
00203     virtual OPCRelationship::tIterator* relationshipsByType( const DWFString& zType ) const
00204         throw();
00205 
00206     _DWFTK_API
00207     virtual void deleteRelationshipsByTarget( OPCPart* pPart )
00208         throw( DWFException );
00209 
00210     _DWFTK_API
00211     virtual DWFInputStream* getInputStream()
00212         throw( DWFException );
00213 
00214     _DWFTK_API
00215     virtual DWFInputStream* getRelationshipsInputStream()
00216         throw( DWFException );
00217 
00218     _DWFTK_API
00219     virtual void loadRelationships(DWFInputStream* pRelsInputStream)
00220         throw( DWFException );
00221 
00222 #ifndef DWFTK_READ_ONLY
00223 
00224     _DWFTK_API
00225     virtual void setInputStream( DWFInputStream* pInputStream, 
00226                                  size_t nBytes,
00227                                  bool bOwnStream = true )
00228         throw( DWFException );
00229 
00230 #endif
00231 
00232 protected:
00233 
00234     DWFString           _zPath;
00235     DWFString           _zName;
00236 
00237     DWFInputStream*     _pInputStream;
00238     size_t              _nStreamBytes;
00239     bool                _bOwnStream;
00240 
00241 private:
00242 
00243     OPCRelationshipContainer*   _pRelsContainer;
00244     
00245 private:
00246 
00247     //
00248     // Not implemented
00249     //
00250     OPCPart( const OPCPart& );
00251     OPCPart& operator=( const OPCPart& );
00252 
00253 };
00254 
00255 }
00256 
00257 #endif

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