00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_DETAIL_RESOBJECTIMPLIF_H 00013 #define ZYPP_DETAIL_RESOBJECTIMPLIF_H 00014 00015 #include <list> 00016 #include <string> 00017 00018 #include "zypp/detail/ResImplTraits.h" 00019 #include "zypp/detail/ResObjectFactory.h" 00020 00021 #include "zypp/Locale.h" 00022 #include "zypp/ByteCount.h" 00023 #include "zypp/Date.h" 00024 #include "zypp/TranslatedText.h" 00025 00026 #include "zypp/NeedAType.h" // volatile include propagating type drafts 00027 00028 // will be defined =0 later 00029 #define PURE_VIRTUAL 00030 00032 namespace zypp 00033 { 00034 00035 class Resolvable; 00036 class Source_Ref; 00037 00039 namespace detail 00040 { 00041 00043 // 00044 // CLASS NAME : ResObjectImplIf 00045 // 00053 class ResObjectImplIf : public base::ReferenceCounted, private base::NonCopyable 00054 { 00055 public: 00069 virtual TranslatedText summary() const PURE_VIRTUAL; 00070 00072 virtual TranslatedText description() const PURE_VIRTUAL; 00073 00075 virtual TranslatedText insnotify() const PURE_VIRTUAL; 00076 00078 virtual TranslatedText delnotify() const PURE_VIRTUAL; 00079 00081 virtual ByteCount size() const PURE_VIRTUAL; 00082 00084 virtual bool providesSources() const PURE_VIRTUAL; 00085 00087 virtual Source_Ref source() const PURE_VIRTUAL; 00088 00090 virtual ZmdId zmdid() const PURE_VIRTUAL; 00091 00098 virtual Label instSrcLabel() const PURE_VIRTUAL; 00100 virtual Vendor instSrcVendor() const PURE_VIRTUAL; 00102 00104 public: 00106 ResObjectImplIf() 00107 : _backRef( 0 ) 00108 {} 00110 virtual ~ResObjectImplIf() = 0; 00111 00113 bool hasBackRef() const 00114 { return _backRef; } 00115 00116 void unmanage() 00117 { _backRef = NULL; } 00118 00119 public: 00121 const Resolvable *const self() const 00122 { return _backRef; } 00124 Resolvable *const self() 00125 { return _backRef; } 00126 00127 private: 00129 template<class _Res> 00130 friend class _resobjectfactory_detail::ResImplConnect; 00132 Resolvable * _backRef; 00133 }; 00135 00136 /* Implementation of pure virtual dtor is required! */ 00137 inline ResObjectImplIf::~ResObjectImplIf() 00138 {} 00139 00141 } // namespace detail 00144 } // namespace zypp 00146 #endif // ZYPP_DETAIL_RESOBJECTIMPLIF_H
1.4.6