libzypp  17.38.17
stringpool.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 ----------------------------------------------------------------------/
9 *
10 * This file contains private API, this might break at any time between releases.
11 * You have been warned!
12 *
13 */
14 // LEGACY-REQUIRED
15 //
16 // This header is consumed by Tier-3 (zypp/) and/or Tier-2 (zypp-logic/) code
17 // and therefore must remain in zypp-logic/. Do not migrate or delete until
18 // `grep -rn 'zypp/ng/sat/stringpool' zypp/ zypp-logic/` returns no hits.
19 #ifndef ZYPPNG_SAT_STRINGPOOL_H_INCLUDED
20 #define ZYPPNG_SAT_STRINGPOOL_H_INCLUDED
21 
22 // poolconstants.h has been migrated to zyppng:sat_poolconstants module partition.
23 // StringPool only needs the raw C types from libsolv + PoolDefines — include directly.
24 extern "C" {
25 #include <solv/pool.h>
26 #include <solv/pool_parserpmrichdep.h>
27 }
29 
30 namespace zyppng::sat {
31 
46  class StringPool {
47 
48  public:
52  static StringPool &instance();
53 
58  ~StringPool();
59 
65  { return _pool; }
66 
72  { return _pool; }
73 
75  zypp::sat::detail::IdType parserpmrichdep( const char * capstr_r )
76  { return ::pool_parserpmrichdep( _pool, capstr_r ); }
77 
78  /* Delete copy and move semantics to maintain singleton integrity */
79  StringPool(const StringPool &) = delete;
80  StringPool(StringPool &&) = delete;
81  StringPool &operator=(const StringPool &) = delete;
82  StringPool &operator=(StringPool &&) = delete;
83 
84  private:
85  StringPool();
86 
87  private:
91  };
92 
93 }
94 #endif
95 
zypp::sat::detail::CPool * _pool
Internal pointer to the libsolv pool structure (CPool).
Definition: stringpool.h:90
~StringPool()
Destructor.
Definition: stringpool.cc:24
int IdType
Generic Id type.
Definition: PoolDefines.h:44
zypp::sat::detail::IdType parserpmrichdep(const char *capstr_r)
libsolv capability parser
Definition: stringpool.h:75
static StringPool & instance()
Access the global StringPool instance.
Definition: stringpool.cc:18
Singleton manager for the underlying libsolv string pool.
Definition: stringpool.h:46
StringPool & operator=(const StringPool &)=delete
zypp::sat::detail::CPool * getPool() const
Explicit accessor for the raw sat-pool.
Definition: stringpool.h:71
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
Definition: PoolDefines.h:36
zypp::sat::detail::CPool * operator->()
Pointer style access forwarded to the raw sat-pool.
Definition: stringpool.h:64