libzypp 17.38.6
stringpool.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9
10#include "stringpool.h"
11
15
16namespace zyppng::sat {
17
19 {
20 static StringPool p;
21 return p;
22 }
23
25 {
26 ::pool_free( _pool );
27 }
28
29 StringPool::StringPool() : _pool( ::pool_create() )
30 {
31 MIL << "Creating sat-pool." << std::endl;
32 if ( ! _pool )
33 {
34 ZYPP_THROW( zypp::Exception( _("Can not create sat-pool.") ) );
35 }
36 }
37
38}
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Definition Exception.h:459
#define _(MSG)
Definition Gettext.h:39
#define MIL
Definition Logger.h:103
Base class for Exception.
Definition Exception.h:153
static StringPool & instance()
Access the global StringPool instance.
Definition stringpool.cc:18
~StringPool()
Destructor.
Definition stringpool.cc:24
StringPool(const StringPool &)=delete
detail::CPool * _pool
Internal pointer to the libsolv pool structure (CPool).
Definition stringpool.h:79
This file contains private API, this might break at any time between releases.