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);
61 Target( const Pathname & root = "/" );
64 Target( const Impl_Ptr & impl_r );
67 friend std::ostream & operator<<( std::ostream & str, const Target & obj );
69 std::ostream & dumpOn( std::ostream & str ) const;
72 /** Pointer to implementation */
73 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
75 static Target_Ptr _nullimpl;
79 ///////////////////////////////////////////////////////////////////
81 /** \relates Target Stream output. */
82 inline std::ostream & operator<<( std::ostream & str, const Target & obj )
83 { return obj.dumpOn( str ); }
86 /////////////////////////////////////////////////////////////////
88 ///////////////////////////////////////////////////////////////////
89 #endif // ZYPP_TARGET_H