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

Implements a non owning storage. More...

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

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

Public Member Functions

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

Detailed Description

Implements a 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::NonOwningStorage::NonOwningStorage ( void *  object)
inline

Initializes the storage pointing it to the given object.

Parameters
objectPointer to the object to reference

Member Function Documentation

void cpp::NonOwningStorage::rebind ( void *  object)
inline

Reassigns the storage to reference another object.

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

Returns a pointer to the storage memory space.

Parameters
alignmentRequired storage alignment. Byte boundary by default
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: