libzypp 17.38.6
poolmember.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9#ifndef POOLMEMBER_H_ZYPPNG_WRAPPER_H
10#define POOLMEMBER_H_ZYPPNG_WRAPPER_H
11
12namespace zyppng::sat {
13
14 class Pool;
15
16 namespace detail {
17 // Primary templates — intentionally left undefined.
18 // Each type that inherits PoolMember<T> must provide an explicit
19 // specialization (declared in its .h, defined in its .cc).
20 // A missing specialization produces a linker error, not a silent
21 // fallback to the global singleton.
22 template <typename T> Pool & poolFromType( T & );
23 template <typename T> const Pool & poolFromType( const T & );
24 }
25
26 template <typename Derived>
28 {
29 public:
31 { return detail::poolFromType( static_cast<Derived &>( *this ) ); }
32
33 const Pool & pool() const
34 { return detail::poolFromType( static_cast<const Derived &>( *this ) ); }
35 };
36
37} // namespace zyppng::sat
38#endif // POOLMEMBER_H_ZYPPNG_WRAPPER_H
const Pool & pool() const
Definition poolmember.h:33
Orchestrator for a libsolv pool instance.
Definition pool.h:37
CLASS NAME : detail::DIWrap.
Definition cap2str.cc:14
Pool & poolFromType(T &)
This file contains private API, this might break at any time between releases.