ZYppFactory.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_ZYPPFACTORY_H
00013 #define ZYPP_ZYPPFACTORY_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "zypp/base/Exception.h"
00018 #include "zypp/ZYpp.h"
00019 
00021 namespace zypp
00022 { 
00023 
00024   class ZYppFactoryException : public Exception
00025   {
00026   public:
00027     ZYppFactoryException( const std::string & msg_r, pid_t locker_pid );
00028     pid_t locker_pid() const { return _locker_pid; }
00029   private:
00030     pid_t _locker_pid;
00031   };
00032 
00034   //
00035   //    CLASS NAME : ZYppFactory
00036   //
00039   class ZYppFactory
00040   {
00041     friend std::ostream & operator<<( std::ostream & str, const ZYppFactory & obj );
00042 
00043   public:
00045     static ZYppFactory instance();
00047     ~ZYppFactory();
00048 
00049   public:
00053     ZYpp::Ptr getZYpp() const;
00054 
00056     bool haveZYpp() const;
00057 
00058   private:
00060     ZYppFactory();
00061   };
00063 
00065   std::ostream & operator<<( std::ostream & str, const ZYppFactory & obj );
00066 
00071   inline ZYpp::Ptr getZYpp()
00072   { return ZYppFactory::instance().getZYpp(); }
00073 
00075 } // namespace zypp
00077 #endif // ZYPP_ZYPPFACTORY_H

doxygen