siplasplas
A library for C++ reflection and introspection
cpp::ConstNonOwningStorage Class Reference

Implements a read-only non owning storage. More...

#include <siplasplas/typeerasure/anystorage/nonowning.hpp>

Inheritance diagram for cpp::ConstNonOwningStorage:
cpp::SimpleAny< ConstNonOwningStorage >

Public Member Functions

 ConstNonOwningStorage (const void *object)
 Initializes the storage pointing it to the given object. More...
 
void rebind (const void *object)
 Reassigns the storage to reference another object. More...
 
const void * storage (cpp::typeerasure::TypeInfo typeInfo) const
 Returns a pointer to the storage memory space. More...
 

Detailed Description

Implements a read-only non owning storage.

A non owning storage stores a reference to an existing object instead of hosting it. Size of non owning storages is always sizeof(void*).

Constructor & Destructor Documentation

cpp::ConstNonOwningStorage::ConstNonOwningStorage ( const void *  object)
inline

Initializes the storage pointing it to the given object.

Parameters
objectPointer to the object to reference

Member Function Documentation

void cpp::ConstNonOwningStorage::rebind ( const void *  object)
inline

Reassigns the storage to reference another object.

Parameters
objectPointer to the new object to reference
const void* cpp::ConstNonOwningStorage::storage ( cpp::typeerasure::TypeInfo  typeInfo) const
inline

Returns a pointer to the storage memory space.

Parameters
typeInfoType information with the required alignment and storage size
Returns
A pointer to the reference object. Alignment is ignored, this function assumes the pointer to the referenced object is valid

The documentation for this class was generated from the following file: