siplasplas
A library for C++ reflection and introspection

Provides different storage backends for cpp::SimpleAny class. More...

Classes

class  cpp::DeadPoolStorage< PreallocatedSize, PreallocatedAlignment >
 Implements fixed-size with fallback to dynamic allocation. More...
 
class  cpp::FixedSizeStorage< Size, Alignment >
 Implements fixed-size storage. More...
 
class  cpp::ConstNonOwningStorage
 Implements a read-only non owning storage. More...
 
class  cpp::NonOwningStorage
 Implements a non owning storage. More...
 

Detailed Description

Provides different storage backends for cpp::SimpleAny class.

cpp::SimpleAny class expects an Storage policy as parameter. Storage policies specify where an object is allocated (hosted), by returning the raw address of the object.

The minimal interface of an Storage class is:

void* Storage::storage(cpp::typeerasure::TypeInfo typeInfo) const
bool Storage::objectFitsInStorage<T>() const

Classes implementing user-defined storage policies may extend this interface, but cpp::SimpleAny should be able to work using storage() function only. objectFitsInStorage() function is used for checks and may not be required in release builds.