Poco

template < typename PlaceholderT, unsigned int SizeV = 64 >

union Placeholder

Library: Foundation
Package: Core
Header: Poco/Any.h

Description

ValueHolder union (used by Poco::Any and Poco::Dynamic::Var for small object optimization, when enabled).

If Holder<Type> fits into POCO_SMALL_OBJECT_SIZE bytes of storage, it will be placement-new-allocated into the local buffer (i.e. there will be no heap-allocation). The local buffer size is one byte larger - [POCO_SMALL_OBJECT_SIZE + 1], additional byte value indicating where the object was allocated. See enum Allocation.

Important: for SOO builds, only same-type (or trivial both-empty no-op) swap operation is allowed.

Member Summary

Member Functions: assign, content, erase, isEmpty, isLocal, operator =, swap

Nested Classes

struct Size

 more...

Constructors

Placeholder inline

Placeholder();

Placeholder

Placeholder(
    const Placeholder & param161
) = delete;

Placeholder

Placeholder(
    Placeholder && param162
) = delete;

Destructor

~Placeholder inline

~Placeholder();

Member Functions

assign inline

template < typename T, typename V, typename std::enable_if_t < TypeSizeLE < T, Placeholder::Size::value >::value > * = __nullptr > PlaceholderT * assign(
    const V & value
);

assign inline

template < typename T, typename V, typename std::enable_if_t < TypeSizeGT < T, Placeholder::Size::value >::value > * = __nullptr > PlaceholderT * assign(
    const V & value
);

content inline

PlaceholderT * content() const;

erase inline

void erase();

isEmpty inline

bool isEmpty() const;

isLocal inline

bool isLocal() const;

operator =

Placeholder & operator = (
    const Placeholder & param163
) = delete;

operator =

Placeholder & operator = (
    Placeholder && param164
) = delete;

swap inline

void swap(
    Placeholder & other
) noexcept;