1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Target.h
17 #include "zypp/base/ReferenceCounted.h"
18 #include "zypp/base/NonCopyable.h"
19 #include "zypp/base/PtrTypes.h"
20 #include "zypp/base/Deprecated.h"
22 #include "zypp/ResStore.h"
23 #include "zypp/Pathname.h"
24 #include "zypp/ResPool.h"
26 ///////////////////////////////////////////////////////////////////
28 { /////////////////////////////////////////////////////////////////
41 DEFINE_PTR_TYPE(Target);
43 ///////////////////////////////////////////////////////////////////
45 // CLASS NAME : Target
49 class Target : public base::ReferenceCounted, public base::NonCopyable
52 typedef target::TargetImpl Impl;
53 typedef intrusive_ptr<Impl> Impl_Ptr;
54 typedef std::list<PoolItem> PoolItemList;
59 * load resolvables into the pool
64 * reload the target in future calls if
66 * note the loading can actually be delayed, but
67 * the next call to resolvables must reflect the
68 * status of the system.
73 * load resolvables of certain kind in the internal store
74 * and return a iterator
75 * successive calls will be faster as resolvables are cached-
77 ResStore::resfilter_const_iterator byKindBegin( const ResObject::Kind & kind_r ) const;
78 ResStore::resfilter_const_iterator byKindEnd( const ResObject::Kind & kind_r ) const;
80 /** Null implementation */
81 static Target_Ptr nullimpl();
83 /** Refference to the RPM database */
84 target::rpm::RpmDb & rpmDb();
86 /** If the package is installed and provides the file
87 Needed to evaluate split provides during Resolver::Upgrade() */
88 bool providesFile (const std::string & name_str, const std::string & path_str) const;
90 ResObject::constPtr whoOwnsFile (const std::string & path_str) const;
92 /** Set the log file for target */
93 bool setInstallationLogfile(const Pathname & path_r);
95 /** Return the root set for this target */
96 Pathname root() const;
98 /** return the last modification date of the target */
99 Date timestamp() const;
103 Target( const Pathname & root = "/" );
106 Target( const Impl_Ptr & impl_r );
109 friend std::ostream & operator<<( std::ostream & str, const Target & obj );
110 /** Stream output. */
111 std::ostream & dumpOn( std::ostream & str ) const;
114 /** Direct access to Impl. */
115 friend class zypp_detail::ZYppImpl;
117 /** Pointer to implementation */
118 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
120 static Target_Ptr _nullimpl;
122 ///////////////////////////////////////////////////////////////////
124 /** \relates Target Stream output. */
125 inline std::ostream & operator<<( std::ostream & str, const Target & obj )
126 { return obj.dumpOn( str ); }
129 /////////////////////////////////////////////////////////////////
131 ///////////////////////////////////////////////////////////////////
132 #endif // ZYPP_TARGET_H