Manages the life cycle of an object.
More...
#include <OGF/gom/services/life_cycle.h>
Manages the life cycle of an object.
Definition at line 59 of file life_cycle.h.
◆ LifeCycle()
OGF::LifeCycle::LifeCycle |
( |
size_t |
object_size, |
|
|
bool |
is_pod = false |
|
) |
| |
|
inline |
LifeCycle constructor.
- Parameters
-
[in] | object_size | the size of an object in bytes. |
Definition at line 66 of file life_cycle.h.
◆ assign()
Calls the assignment operator.
- Parameters
-
[in] | lhs | the address of the left hand side. |
[in] | rhs | the address of the right hand side. |
Implemented in OGF::GenericLifeCycle< T >.
◆ assign_array()
Copies an array of object at a given address.
- Parameters
-
[in] | lhs | the address of the left-hand-side objects |
[in] | rhs | the address of the right-hand-side objects to be copied. |
[in] | nb | number of objects |
No memory allocation is done.
Implemented in OGF::GenericLifeCycle< T >.
◆ construct()
Calls the constructor of an object.
- Parameters
-
[in] | address | the address of the object to be constructed. |
No memory allocation is done.
Implemented in OGF::GenericLifeCycle< T >.
◆ construct_array()
Calls the constructor of objects in an array.
- Parameters
-
[in] | address | the address of the object array to be constructed. |
[in] | nb | number of objects. |
No memory allocation is done.
Implemented in OGF::GenericLifeCycle< T >.
◆ copy_construct()
Copy-Constructs an object at a given address.
- Parameters
-
[in] | lhs | the address where the object should be constructed. |
[in] | rhs | the address of the right-hand-side object to be copied. |
No memory allocation is done.
Implemented in OGF::GenericLifeCycle< T >.
◆ copy_construct_array()
Copy-Constructs an array of object at a given address.
- Parameters
-
[in] | lhs | the address of the objects to be constructed. |
[in] | rhs | the address of the right-hand-side objects to be copied. |
[in] | nb | number of objects |
No memory allocation is done.
Implemented in OGF::GenericLifeCycle< T >.
◆ delete_array()
Deletes an array of objects.
- Parameters
-
[in] | address | the address of the object array to be deleted. |
Implemented in OGF::GenericLifeCycle< T >.
◆ delete_object()
◆ destroy()
Calls the destructor of an object.
- Parameters
-
[in] | address | the address of the object to be destructed. |
No memory deallocation is done.
Implemented in OGF::GenericLifeCycle< T >.
◆ destroy_array()
Destroys an array of object at a given address.
- Parameters
-
[in] | address | the address of the objects to be destroyed. |
[in] | nb | number of objects |
No memory deallocation is done.
Implemented in OGF::GenericLifeCycle< T >.
◆ is_pod()
bool OGF::LifeCycle::is_pod |
( |
| ) |
const |
|
inline |
Tests whether object is pod (plain ordinary datatype).
Plain ordinary datatypes can be copied with memcpy().
- Return values
-
true | if object is pod. |
false | otherwise. |
Definition at line 91 of file life_cycle.h.
◆ new_array()
◆ new_object() [1/2]
◆ new_object() [2/2]
Dynamically allocates a new object with copy constructor.
- Parameters
-
[in] | rhs | the address of the right-hand-side objects to be copied. |
- Returns
- the address of the new object.
Implemented in OGF::GenericLifeCycle< T >.
◆ object_size()
size_t OGF::LifeCycle::object_size |
( |
| ) |
const |
|
inline |
Gets the size of an object.
- Returns
- the size of an object in bytes.
Definition at line 79 of file life_cycle.h.
The documentation for this class was generated from the following file: