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 /** Commit 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 */
78 /** If the package is installed and provides the file
79 Needed to evaluate split provides during Resolver::Upgrade() */
80 bool providesFile (const std::string & name_str, const std::string & path_str) const;
83 /** All resolvables provided by the target. */
85 /** Path to the target */
90 /** Null implementation */
91 static TargetImpl_Ptr _nullimpl;
93 ///////////////////////////////////////////////////////////////////
95 /** \relates TargetImpl Stream output */
96 inline std::ostream & operator<<( std::ostream & str, const TargetImpl & obj )
97 { return obj.dumpOn( str ); }
99 /////////////////////////////////////////////////////////////////
100 } // namespace target
101 ///////////////////////////////////////////////////////////////////
102 /////////////////////////////////////////////////////////////////
104 ///////////////////////////////////////////////////////////////////
105 #endif // ZYPP_TARGET_TARGETIMPL_H