![]() |
mutable
A Database System for Research and Fast Prototyping
|
A data type representing a pooled (or internalized) object. More...
#include <Pool.hpp>
Public Types | |
using | value_type = typename Pool::table_type::value_type |
Public Member Functions | |
Pooled ()=default | |
Pooled (const Pooled &other) | |
Pooled (Pooled &&other) | |
Pooled (const Pooled< T, Pool, false > &other) | |
| |
Pooled (Pooled< T, Pool, false > &&other) | |
| |
Pooled (const Pooled< T, Pool, true > &other) | |
| |
Pooled (Pooled< T, Pool, true > &&other) | |
| |
bool | has_value () const |
Pooled< T, Pool, false > | assert_not_none () const |
uint32_t | count () const |
Returns the number of references to the pooled object or 0 if this Pooled CanBeNone and does not hold a reference to an object. | |
~Pooled () | |
Pooled & | operator= (Pooled other) |
operator const T & () const | |
operator const T * () const | |
const T & | operator* () const |
const T * | operator-> () const |
template<typename U > requires std::is_polymorphic_v<typename Pool::pooled_type> | |
and (std::derived_from< U, T > or std::derived_from< T, U >) Pooled< U | |
Explicitly casts this Pooled<T> to Pooled<U> . | |
false | as () const |
template<typename U > requires std::is_polymorphic_v<typename Pool::pooled_type> | |
and std::derived_from< T, U > | operator Pooled< U, Pool, false > () |
Implicitly casts this Pooled<T> to Pooled<U> . | |
template<typename U , bool _CanBeNone> requires std::is_polymorphic_v<typename Pool::pooled_type> | |
and std::derived_from< U, T > Pooled & | operator= (Pooled< U, Pool, _CanBeNone > other) |
Assigns a Pooled<U> to this Pooled<T> . | |
template<typename U , bool _CanBeNone> | |
bool | operator== (Pooled< U, Pool, _CanBeNone > other) const |
template<typename U , bool _CanBeNone> | |
bool | operator!= (Pooled< U, Pool, _CanBeNone > other) const |
template<typename U > | |
bool | operator== (const U *other) const |
template<typename U > | |
bool | operator!= (const U *other) const |
void | dump (std::ostream &out) const |
void | dump () const |
Data Fields | |
friend | Pool |
| |
Pool | |
Static Public Attributes | |
static constexpr bool | can_be_none = CanBeNone |
| |
Private Member Functions | |
Pooled (Pool *pool, value_type *value) | |
Constucts a fresh Pooled from a pooled. | |
Private Attributes | |
Pool * | pool_ = nullptr |
| |
value_type * | ref_ = nullptr |
| |
Friends | |
template<typename , typename , bool > | |
struct | Pooled |
| |
void | swap (Pooled &first, Pooled &second) |
std::ostream & | operator<< (std::ostream &out, const Pooled &pooled) |
A data type representing a pooled (or internalized) object.
If
|
inlineprivate |
Constucts a fresh Pooled
from a pooled.
value | and its owning |
pool. |
Definition at line 194 of file Pool.hpp.
References M_insist, M_notnull, m::Pooled< T, Pool, CanBeNone >::pool_, and m::Pooled< T, Pool, CanBeNone >::ref_.
Definition at line 206 of file Pool.hpp.
References m::Pooled< T, Pool, CanBeNone >::swap.
Definition at line 251 of file Pool.hpp.
References M_insist, m::Pooled< T, Pool, CanBeNone >::pool_, and m::Pooled< T, Pool, CanBeNone >::ref_.
Definition at line 276 of file Pool.hpp.
References M_insist, m::Pooled< T, Pool, CanBeNone >::pool_, and m::Pooled< T, Pool, CanBeNone >::ref_.
Definition at line 239 of file Pool.hpp.
References m::Pooled< T, Pool, CanBeNone >::has_value(), m::Pooled< T, Pool, CanBeNone >::pool_, and m::Pooled< T, Pool, CanBeNone >::ref_.
Referenced by m::ArgParser::add(), m::Schema::Identifier::Identifier(), and m::wasm::ExprCompiler::operator()().
Returns the number of references to the pooled object or 0 if this Pooled
CanBeNone and does not hold a reference to an object.
Definition at line 249 of file Pool.hpp.
References m::Pooled< T, Pool, CanBeNone >::ref_.
Referenced by m::Pooled< T, Pool, CanBeNone >::dump().
Definition at line 328 of file Pool.hpp.
References m::Pooled< T, Pool, CanBeNone >::dump().
Referenced by m::Pooled< T, Pool, CanBeNone >::dump().
Definition at line 323 of file Pool.hpp.
References m::Pooled< T, Pool, CanBeNone >::count(), and m::Pool< T, Hash, KeyEqual, ThreadSafe >::Get().
Definition at line 237 of file Pool.hpp.
References m::Pooled< T, Pool, CanBeNone >::ref_.
Referenced by m::Pooled< T, Pool, CanBeNone >::assert_not_none(), m::ast::Parser::parse_data_type(), and m::ConcreteTable::schema().
Definition at line 264 of file Pool.hpp.
References m::Pool< T, Hash, KeyEqual, ThreadSafe >::Get(), and m::T().
Definition at line 265 of file Pool.hpp.
References m::Pool< T, Hash, KeyEqual, ThreadSafe >::Get(), and m::T().
|
inline |
Definition at line 314 of file Pool.hpp.
References m::Pooled< T, Pool, CanBeNone >::operator==().
|
inline |
Definition at line 310 of file Pool.hpp.
References m::Pooled< T, Pool, CanBeNone >::operator==().
Definition at line 267 of file Pool.hpp.
References m::Pool< T, Hash, KeyEqual, ThreadSafe >::Get(), and m::T().
Definition at line 268 of file Pool.hpp.
References m::Pool< T, Hash, KeyEqual, ThreadSafe >::Get(), and m::T().
Definition at line 262 of file Pool.hpp.
References m::Pooled< T, Pool, CanBeNone >::swap.
|
inline |
Assigns a Pooled<U>
to this Pooled<T>
.
Only supports up-casting. Requires that the underlying type is polymorphic and rhs type(
U | ) is derived from lhs type (T ). The rhs can be optional or non-optional Pooled , in either case it can not be empty. |
Definition at line 299 of file Pool.hpp.
References M_insist, m::Pooled< T, Pool, CanBeNone >::pool_, m::Pooled< T, Pool, CanBeNone >::ref_, and m::Pooled< T, Pool, CanBeNone >::swap.
|
inline |
Definition at line 312 of file Pool.hpp.
References m::Pool< T, Hash, KeyEqual, ThreadSafe >::Get().
|
inline |
Definition at line 308 of file Pool.hpp.
References m::Pooled< T, Pool, CanBeNone >::ref_.
Referenced by m::Pooled< T, Pool, CanBeNone >::operator!=().
Definition at line 181 of file Pool.hpp.
Referenced by m::Pooled< T, Pool, CanBeNone >::operator=(), and m::Pooled< T, Pool, CanBeNone >::Pooled().
The pool holding this value. Can only be
nullptr
ifCanBeNone
or if thePooled
instance is moved.
Definition at line 189 of file Pool.hpp.
Referenced by m::Pooled< T, Pool, CanBeNone >::as(), m::Pooled< T, Pool, CanBeNone >::assert_not_none(), m::Pooled< T, Pool, CanBeNone >::operator=(), m::Pooled< T, Pool, CanBeNone >::Pooled(), and m::Pooled< T, Pool, CanBeNone >::~Pooled().
|
private |
The pointer to the pooled object. Can only be
nullptr
ifCanBeNone
or if thePooled
instance is moved.
Definition at line 191 of file Pool.hpp.
Referenced by m::Pooled< T, Pool, CanBeNone >::as(), m::Pooled< T, Pool, CanBeNone >::assert_not_none(), m::Pooled< T, Pool, CanBeNone >::count(), m::PODPool< T, Hash, KeyEqual, Copy, ThreadSafe >::erase(), m::Pool< T, Hash, KeyEqual, ThreadSafe >::erase(), m::PODPool< T, Hash, KeyEqual, Copy, ThreadSafe >::Get(), m::Pool< T, Hash, KeyEqual, ThreadSafe >::Get(), m::Pooled< T, Pool, CanBeNone >::has_value(), m::Pooled< T, Pool, CanBeNone >::operator=(), m::Pooled< T, Pool, CanBeNone >::operator==(), m::Pooled< T, Pool, CanBeNone >::Pooled(), and m::Pooled< T, Pool, CanBeNone >::~Pooled().