1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ZYppFactory.h
12 #ifndef ZYPP_ZYPPFACTORY_H
13 #define ZYPP_ZYPPFACTORY_H
17 #include "zypp/base/Exception.h"
18 #include "zypp/ZYpp.h"
20 ///////////////////////////////////////////////////////////////////
22 { /////////////////////////////////////////////////////////////////
24 class ZYppFactoryException : public Exception
27 ZYppFactoryException( const std::string & msg_r );
30 ///////////////////////////////////////////////////////////////////
32 // CLASS NAME : ZYppFactory
34 /** ZYpp factory class (Singleton)
38 friend std::ostream & operator<<( std::ostream & str, const ZYppFactory & obj );
42 static ZYppFactory instance();
47 /** \return Pointer to the ZYpp instance.
48 * \throw EXCEPTION In case we can't acquire a lock.
50 ZYpp::Ptr getZYpp() const;
56 ///////////////////////////////////////////////////////////////////
58 /** \relates ZYppFactory Stream output */
59 std::ostream & operator<<( std::ostream & str, const ZYppFactory & obj );
61 /** \relates ZYppFactory Convenience to get the Pointer
62 * to the ZYpp instance.
63 * \see ZYppFactory::getZYpp
65 inline ZYpp::Ptr getZYpp()
66 { return ZYppFactory::instance().getZYpp(); }
68 /////////////////////////////////////////////////////////////////
70 ///////////////////////////////////////////////////////////////////
71 #endif // ZYPP_ZYPPFACTORY_H