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/base/Deprecated.h"
00016 
00017 #include "zypp/detail/ResObjectImplIf.h"
00018 #include "zypp/Resolvable.h"
00019 #include "zypp/TranslatedText.h"
00020 #include "zypp/NeedAType.h"
00021 #include "zypp/Date.h"
00022 #include "zypp/OnMediaLocation.h"
00023 
00025 namespace zypp
00026 { 
00027   namespace detail {
00028     class ImplConnect;
00029     class ResObjectImplIf;
00030   }
00031 
00032   class Repository;
00033   class ByteCount;
00034 
00036   //
00037   //    CLASS NAME : ResObject
00038   //
00044   class ResObject : public Resolvable
00045   {
00046   public:
00047     typedef detail::ResObjectImplIf  Impl;
00048     typedef ResObject                Self;
00049     typedef ResTraits<Self>          TraitsType;
00050     typedef TraitsType::PtrType      Ptr;
00051     typedef TraitsType::constPtrType constPtr;
00052 
00053   public:
00058     Text summary() const;
00059 
00063     Text description() const;
00064 
00071     Text insnotify() const;
00072 
00079     Text delnotify() const;
00080 
00087     Text licenseToConfirm() const;
00088 
00094     Vendor vendor() const;
00095 
00097     ByteCount size() const;
00098 
00100     ByteCount downloadSize() const;
00101 
00106     ZYPP_DEPRECATED ByteCount archivesize() const
00107     { return downloadSize(); }
00108 
00112     Repository repository() const;
00113 
00118     unsigned mediaNr() const;
00119 
00123     bool installOnly() const;
00124 
00128     Date buildtime() const;
00129 
00134     Date installtime() const;
00135 
00142     const DiskUsage & diskusage() const;
00143 
00144   protected:
00146     ResObject( const Kind & kind_r,
00147                const NVRAD & nvrad_r );
00149     virtual ~ResObject();
00150 
00152     virtual std::ostream & dumpOn( std::ostream & str ) const;
00153 
00154   private:
00155     friend class detail::ImplConnect;
00157     virtual Impl & pimpl() = 0;
00159     virtual const Impl & pimpl() const = 0;
00160   };
00162 
00171   template<class _Res>
00172     inline typename ResTraits<_Res>::PtrType asKind( const ResObject::Ptr & p )
00173     { return dynamic_pointer_cast<_Res>(p); }
00174 
00175   template<class _Res>
00176     inline typename ResTraits<_Res>::constPtrType asKind( const ResObject::constPtr & p )
00177     { return dynamic_pointer_cast<const _Res>(p); }
00178 
00180 } // namespace zypp
00182 #endif // ZYPP_RESOBJECT_H

Generated on Tue Sep 25 19:23:06 2007 for libzypp by  doxygen 1.5.3