*
*/
#include "zypp/ResObject.h"
+#include "zypp/detail/ResObjectImplIf.h"
using namespace std;
#define ZYPP_RESOBJECT_H
#include "zypp/Resolvable.h"
-#include "zypp/detail/ResObjectImplIf.h"
+//#include "zypp/detail/ResObjectImplIf.h"
+#include "zypp/NeedAType.h"
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
+ namespace detail {
+ class ResObjectImplIf;
+ }
///////////////////////////////////////////////////////////////////
//
*
*/
#include "zypp/detail/ResObjectImplIf.h"
+#include "zypp/source/SourceImpl.h"
+#include "zypp/SourceFactory.h"
///////////////////////////////////////////////////////////////////
namespace zypp
bool ResObjectImplIf::providesSources() const
{ return false; }
+ Source ResObjectImplIf::source() const
+ { return SourceFactory().createFrom(source::SourceImpl::nullimpl()); }
+
Label ResObjectImplIf::instSrcLabel() const
{ return Label(); }
#include "zypp/Date.h"
#include "zypp/NeedAType.h" // volatile include propagating type drafts
+#include "zypp/Source.h"
// will be defined =0 later
#define PURE_VIRTUAL
/** Wheter there are src.rpm available too. */
virtual bool providesSources() const PURE_VIRTUAL;
+ /** Installation source which provides the package */
+ virtual Source source() const PURE_VIRTUAL;
+
/** \name deprecated
* \todo These should be replaced by a offering a
* Ptr to the Source.
IMPL_PTR_TYPE(SourceImpl);
+ SourceImpl_Ptr SourceImpl::_nullimpl;
+
+ /** Null implementation */
+ SourceImpl_Ptr SourceImpl::nullimpl()
+ {
+ if (_nullimpl == 0)
+ _nullimpl = new SourceImpl;
+ return _nullimpl;
+ }
+
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : SourceImpl::SourceImpl
friend std::ostream & operator<<( std::ostream & str, const SourceImpl & obj );
public:
- /** Ctor, FIXME it is here only because of target storage */
+ /** Ctor, FIXME it is here only because of target storage, then make it private */
SourceImpl()
{}
/** Ctor. */
/** Dtor. */
virtual ~SourceImpl();
+ /** Null implementation */
+ static SourceImpl_Ptr nullimpl();
+
public:
/** All resolvables provided by this source. */
Pathname _path;
/** The source is enabled */
bool _enabled;
+ private:
+ /** Null implementation */
+ static SourceImpl_Ptr _nullimpl;
};
///////////////////////////////////////////////////////////////////