Graphite  Version 3
An experimental 3D geometry processing program
OGF::GenericLifeCycle< T > Class Template Reference

Concrete implementation of LifeCycle. More...

#include <OGF/gom/services/life_cycle.h>

Inheritance diagram for OGF::GenericLifeCycle< T >:
OGF::LifeCycle GEO::Counted

Public Member Functions

 GenericLifeCycle ()
 GenericLifeCycle constructor.
 
void construct (Memory::pointer address) override
 Calls the constructor of an object. More...
 
void copy_construct (Memory::pointer lhs, Memory::pointer rhs) override
 Copy-Constructs an object at a given address. More...
 
void destroy (Memory::pointer address) override
 Calls the destructor of an object. More...
 
void assign (Memory::pointer lhs, Memory::pointer rhs) override
 Calls the assignment operator. More...
 
void construct_array (Memory::pointer address, index_t nb) override
 Calls the constructor of objects in an array. More...
 
void copy_construct_array (Memory::pointer lhs, Memory::pointer rhs, index_t nb) override
 Copy-Constructs an array of object at a given address. More...
 
void destroy_array (Memory::pointer address, index_t nb) override
 Destroys an array of object at a given address. More...
 
void assign_array (Memory::pointer lhs, Memory::pointer rhs, index_t nb) override
 Copies an array of object at a given address. More...
 
Memory::pointer new_object () override
 Dynamically allocates a new object. More...
 
Memory::pointer new_object (Memory::pointer rhs) override
 Dynamically allocates a new object. More...
 
void delete_object (Memory::pointer address) override
 Deletes an object. More...
 
Memory::pointer new_array (index_t nb) override
 Dynamically allocates an array of objects. More...
 
void delete_array (Memory::pointer address) override
 Deletes an array of objects. More...
 
- Public Member Functions inherited from OGF::LifeCycle
 LifeCycle (size_t object_size, bool is_pod=false)
 LifeCycle constructor. More...
 
virtual ~LifeCycle ()
 LifeCycle destructor.
 
size_t object_size () const
 Gets the size of an object. More...
 
bool is_pod () const
 Tests whether object is pod (plain ordinary datatype). More...
 
- Public Member Functions inherited from GEO::Counted
void ref () const
 Increments the reference count. More...
 
void unref () const
 Decrements the reference count. More...
 
bool is_shared () const
 Check if the object is shared. More...
 
int nb_refs () const
 Gets the number of references that point to this object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from GEO::Counted
static void ref (const Counted *counted)
 Increments the reference count. More...
 
static void unref (const Counted *counted)
 Decrements the reference count. More...
 
- Protected Member Functions inherited from GEO::Counted
 Counted ()
 Creates a reference counted object. More...
 
virtual ~Counted ()
 Destroys a reference counted object. More...
 

Detailed Description

template<class T>
class OGF::GenericLifeCycle< T >

Concrete implementation of LifeCycle.

Definition at line 212 of file life_cycle.h.

Member Function Documentation

◆ assign()

template<class T >
void OGF::GenericLifeCycle< T >::assign ( Memory::pointer  lhs,
Memory::pointer  rhs 
)
inlineoverridevirtual

Calls the assignment operator.

Parameters
[in]lhsthe address of the left hand side.
[in]rhsthe address of the right hand side.

Implements OGF::LifeCycle.

Definition at line 246 of file life_cycle.h.

◆ assign_array()

template<class T >
void OGF::GenericLifeCycle< T >::assign_array ( Memory::pointer  lhs,
Memory::pointer  rhs,
index_t  nb 
)
inlineoverridevirtual

Copies an array of object at a given address.

Parameters
[in]lhsthe address of the left-hand-side objects
[in]rhsthe address of the right-hand-side objects to be copied.
[in]nbnumber of objects

No memory allocation is done.

Implements OGF::LifeCycle.

Definition at line 287 of file life_cycle.h.

◆ construct()

template<class T >
void OGF::GenericLifeCycle< T >::construct ( Memory::pointer  address)
inlineoverridevirtual

Calls the constructor of an object.

Parameters
[in]addressthe address of the object to be constructed.

No memory allocation is done.

Implements OGF::LifeCycle.

Definition at line 224 of file life_cycle.h.

◆ construct_array()

template<class T >
void OGF::GenericLifeCycle< T >::construct_array ( Memory::pointer  address,
index_t  nb 
)
inlineoverridevirtual

Calls the constructor of objects in an array.

Parameters
[in]addressthe address of the object array to be constructed.
[in]nbnumber of objects.

No memory allocation is done.

Implements OGF::LifeCycle.

Definition at line 253 of file life_cycle.h.

◆ copy_construct()

template<class T >
void OGF::GenericLifeCycle< T >::copy_construct ( Memory::pointer  lhs,
Memory::pointer  rhs 
)
inlineoverridevirtual

Copy-Constructs an object at a given address.

Parameters
[in]lhsthe address where the object should be constructed.
[in]rhsthe address of the right-hand-side object to be copied.

No memory allocation is done.

Implements OGF::LifeCycle.

Definition at line 231 of file life_cycle.h.

◆ copy_construct_array()

template<class T >
void OGF::GenericLifeCycle< T >::copy_construct_array ( Memory::pointer  lhs,
Memory::pointer  rhs,
index_t  nb 
)
inlineoverridevirtual

Copy-Constructs an array of object at a given address.

Parameters
[in]lhsthe address of the objects to be constructed.
[in]rhsthe address of the right-hand-side objects to be copied.
[in]nbnumber of objects

No memory allocation is done.

Implements OGF::LifeCycle.

Definition at line 263 of file life_cycle.h.

◆ delete_array()

template<class T >
void OGF::GenericLifeCycle< T >::delete_array ( Memory::pointer  address)
inlineoverridevirtual

Deletes an array of objects.

Parameters
[in]addressthe address of the object array to be deleted.

Implements OGF::LifeCycle.

Definition at line 328 of file life_cycle.h.

◆ delete_object()

template<class T >
void OGF::GenericLifeCycle< T >::delete_object ( Memory::pointer  address)
inlineoverridevirtual

Deletes an object.

Parameters
[in]addressthe address of the object.

Implements OGF::LifeCycle.

Definition at line 314 of file life_cycle.h.

◆ destroy()

template<class T >
void OGF::GenericLifeCycle< T >::destroy ( Memory::pointer  address)
inlineoverridevirtual

Calls the destructor of an object.

Parameters
[in]addressthe address of the object to be destructed.

No memory deallocation is done.

Implements OGF::LifeCycle.

Definition at line 238 of file life_cycle.h.

◆ destroy_array()

template<class T >
void OGF::GenericLifeCycle< T >::destroy_array ( Memory::pointer  address,
index_t  nb 
)
inlineoverridevirtual

Destroys an array of object at a given address.

Parameters
[in]addressthe address of the objects to be destroyed.
[in]nbnumber of objects

No memory deallocation is done.

Implements OGF::LifeCycle.

Definition at line 276 of file life_cycle.h.

◆ new_array()

template<class T >
Memory::pointer OGF::GenericLifeCycle< T >::new_array ( index_t  nb)
inlineoverridevirtual

Dynamically allocates an array of objects.

Parameters
[in]nbnumber of objects.

Implements OGF::LifeCycle.

Definition at line 321 of file life_cycle.h.

◆ new_object() [1/2]

template<class T >
Memory::pointer OGF::GenericLifeCycle< T >::new_object ( )
inlineoverridevirtual

Dynamically allocates a new object.

Returns
the address of the new object.

Implements OGF::LifeCycle.

Definition at line 300 of file life_cycle.h.

◆ new_object() [2/2]

template<class T >
Memory::pointer OGF::GenericLifeCycle< T >::new_object ( Memory::pointer  rhs)
inlineoverridevirtual

Dynamically allocates a new object.

Returns
the address of the new object.

Implements OGF::LifeCycle.

Definition at line 307 of file life_cycle.h.


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