ResObject.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_RESOBJECT_H
00013 #define ZYPP_RESOBJECT_H
00014 
00015 #include "zypp/detail/ResObjectImplIf.h"
00016 #include "zypp/Resolvable.h"
00017 #include "zypp/TranslatedText.h"
00018 #include "zypp/NeedAType.h"
00019 
00021 namespace zypp
00022 { 
00023   namespace detail {
00024     class ImplConnect;
00025     class ResObjectImplIf;
00026   }
00027   class Source_Ref;
00028   class ByteCount;
00029 
00031   //
00032   //    CLASS NAME : ResObject
00033   //
00036   class ResObject : public Resolvable
00037   {
00038   public:
00039     typedef detail::ResObjectImplIf  Impl;
00040     typedef ResObject                Self;
00041     typedef ResTraits<Self>          TraitsType;
00042     typedef TraitsType::PtrType      Ptr;
00043     typedef TraitsType::constPtrType constPtr;
00044 
00045   public:
00047     Text summary() const;
00048 
00050     Text description() const;
00051 
00053     Text insnotify() const;
00054 
00056     Text delnotify() const;
00057 
00059     ByteCount size() const;
00060 
00062     Source_Ref source() const;
00063 
00065     ZmdId zmdid () const;
00066 
00067   protected:
00069     ResObject( const Kind & kind_r,
00070                const NVRAD & nvrad_r );
00072     virtual ~ResObject();
00073 
00074   private:
00075     friend class detail::ImplConnect;
00077     virtual Impl & pimpl() = 0;
00079     virtual const Impl & pimpl() const = 0;
00080   };
00082 
00091   template<class _Res>
00092     inline typename ResTraits<_Res>::PtrType asKind( const ResObject::Ptr & p )
00093     { return dynamic_pointer_cast<_Res>(p); }
00094 
00095   template<class _Res>
00096     inline typename ResTraits<_Res>::constPtrType asKind( const ResObject::constPtr & p )
00097     { return dynamic_pointer_cast<const _Res>(p); }
00098 
00100 } // namespace zypp
00102 #endif // ZYPP_RESOBJECT_H

Generated on Thu May 4 16:03:24 2006 for zypp by  doxygen 1.4.6