1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Target.h
17 #include "zypp/base/PtrTypes.h"
19 #include "zypp/ResStore.h"
20 #include "zypp/Pathname.h"
21 #include "zypp/ResPool.h"
23 ///////////////////////////////////////////////////////////////////
25 { /////////////////////////////////////////////////////////////////
34 DEFINE_PTR_TYPE(Target);
36 ///////////////////////////////////////////////////////////////////
38 // CLASS NAME : Target
42 class Target : public base::ReferenceCounted, public base::NonCopyable
45 typedef target::TargetImpl Impl;
46 typedef intrusive_ptr<Impl> Impl_Ptr;
50 /** All resolvables provided by the target. */
51 const ResStore & resolvables();
52 /** Null implementation */
53 static Target_Ptr nullimpl();
54 /** Refference to the RPM database */
55 target::rpm::RpmDb & rpmDb();
56 /** Comomit changes in the pool */
57 void commit(ResPool pool_r);
62 Target( const Pathname & root = "/" );
65 Target( const Impl_Ptr & impl_r );
68 friend std::ostream & operator<<( std::ostream & str, const Target & obj );
70 std::ostream & dumpOn( std::ostream & str ) const;
73 /** Pointer to implementation */
74 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
76 static Target_Ptr _nullimpl;
80 ///////////////////////////////////////////////////////////////////
82 /** \relates Target Stream output. */
83 inline std::ostream & operator<<( std::ostream & str, const Target & obj )
84 { return obj.dumpOn( str ); }
87 /////////////////////////////////////////////////////////////////
89 ///////////////////////////////////////////////////////////////////
90 #endif // ZYPP_TARGET_H