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 (0 => heap, 1 => local).

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 & param129
) = delete;

Placeholder

Placeholder(
    Placeholder && param130
) = delete;

Destructor

~Placeholder inline

~Placeholder();

Member Functions

assign inline

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

assign inline

template < typename T, typename V, typename std::enable_if < TypeSizeGT < T, Placeholder::Size::value >::value >::type * = 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 & param131
) = delete;

operator =

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

swap inline

void swap(
    Placeholder & other
) noexcept;