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 00023 namespace zypp 00024 { 00025 namespace detail { 00026 class ImplConnect; 00027 class ResObjectImplIf; 00028 } 00029 class Source_Ref; 00030 class ByteCount; 00031 00033 // 00034 // CLASS NAME : ResObject 00035 // 00038 class ResObject : public Resolvable 00039 { 00040 public: 00041 typedef detail::ResObjectImplIf Impl; 00042 typedef ResObject Self; 00043 typedef ResTraits<Self> TraitsType; 00044 typedef TraitsType::PtrType Ptr; 00045 typedef TraitsType::constPtrType constPtr; 00046 00047 public: 00049 Text summary() const; 00050 00052 Text description() const; 00053 00055 Text insnotify() const; 00056 00058 Text delnotify() const; 00059 00061 Text licenseToConfirm() const; 00062 00064 Vendor vendor() const; 00065 00067 ByteCount size() const; 00068 00070 ByteCount archivesize() const; 00071 00073 Source_Ref source() const; 00074 00079 unsigned sourceMediaNr() const; 00080 00082 ZYPP_DEPRECATED unsigned mediaId() const 00083 { return sourceMediaNr(); } 00084 00086 bool installOnly() const; 00087 00089 Date buildtime() const; 00090 00092 Date installtime() const; 00093 00095 ZmdId zmdid () const; 00096 00097 protected: 00099 ResObject( const Kind & kind_r, 00100 const NVRAD & nvrad_r ); 00102 virtual ~ResObject(); 00103 00105 virtual std::ostream & dumpOn( std::ostream & str ) const; 00106 00107 private: 00108 friend class detail::ImplConnect; 00110 virtual Impl & pimpl() = 0; 00112 virtual const Impl & pimpl() const = 0; 00113 }; 00115 00124 template<class _Res> 00125 inline typename ResTraits<_Res>::PtrType asKind( const ResObject::Ptr & p ) 00126 { return dynamic_pointer_cast<_Res>(p); } 00127 00128 template<class _Res> 00129 inline typename ResTraits<_Res>::constPtrType asKind( const ResObject::constPtr & p ) 00130 { return dynamic_pointer_cast<const _Res>(p); } 00131 00133 } // namespace zypp 00135 #endif // ZYPP_RESOBJECT_H