1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/target/TargetImpl.h
12 #ifndef ZYPP_TARGET_TARGETIMPL_H
13 #define ZYPP_TARGET_TARGETIMPL_H
17 #include "zypp/base/ReferenceCounted.h"
18 #include "zypp/base/NonCopyable.h"
19 #include "zypp/base/PtrTypes.h"
20 #include "zypp/ResStore.h"
22 #include "zypp/Pathname.h"
23 #include "zypp/media/MediaAccess.h"
24 #include "zypp/Target.h"
25 #include "zypp/target/rpm/RpmDb.h"
26 #include "zypp/solver/detail/Types.h"
28 ///////////////////////////////////////////////////////////////////
30 { /////////////////////////////////////////////////////////////////
31 ///////////////////////////////////////////////////////////////////
33 { /////////////////////////////////////////////////////////////////
35 DEFINE_PTR_TYPE(TargetImpl);
37 ///////////////////////////////////////////////////////////////////
39 // CLASS NAME : TargetImpl
41 /** Base class for concrete Target implementations.
43 * Constructed by \ref TargetFactory. Public access via \ref Target
46 class TargetImpl : public base::ReferenceCounted, private base::NonCopyable
48 friend std::ostream & operator<<( std::ostream & str, const TargetImpl & obj );
52 TargetImpl(const Pathname & root_r = "/");
54 virtual ~TargetImpl();
56 /** Null implementation */
57 static TargetImpl_Ptr nullimpl();
61 /** All resolvables in the target. */
62 const ResStore & resolvables();
64 /** Comomit changes in the pool */
65 #warning Add support for multiple medias - eg. limit only to CD1
66 void commit(ResPool pool_r);
68 /** Comomit ordered changes */
69 void commit(const PoolItemList & items_r);
71 /** Overload to realize stream output. */
72 virtual std::ostream & dumpOn( std::ostream & str ) const
73 { return str << "TargetImpl"; }
75 /** The RPM database */
79 /** All resolvables provided by the target. */
81 /** Path to the target */
86 /** Null implementation */
87 static TargetImpl_Ptr _nullimpl;
89 ///////////////////////////////////////////////////////////////////
91 /** \relates TargetImpl Stream output */
92 inline std::ostream & operator<<( std::ostream & str, const TargetImpl & obj )
93 { return obj.dumpOn( str ); }
95 /////////////////////////////////////////////////////////////////
97 ///////////////////////////////////////////////////////////////////
98 /////////////////////////////////////////////////////////////////
100 ///////////////////////////////////////////////////////////////////
101 #endif // ZYPP_TARGET_TARGETIMPL_H