A class for representing and handling data of an arbitrary type.
More...
#include <ObjectData.h>
A class for representing and handling data of an arbitrary type.
This class encapsulates generic objects by providing constructors, destructors, and meta data extraction functionalities for an arbitrary type.
Example
This class must be used with the template type being the type you are working with.
class CExampleClass {};
CExampleClass* example = data.
construct<CExampleClass>();
std::shared_ptr<CExampleClass> sharedExample = data.
constructShared<CExampleClass>();
size_t classSize = data.
size();
A class for representing and handling data of an arbitrary type.
Definition: ObjectData.h:37
bool hasVirtual() const
Getter for m_fHasVirtual.
Definition: ObjectData.h:159
size_t size() const
Getter for m_nClassSize.
Definition: ObjectData.h:152
std::shared_ptr< T > constructShared()
Constructs an object of a specific type.
Definition: ObjectData.h:111
void deconstruct(T *i_tData)
Deconstructs an object of a specific type.
Definition: ObjectData.h:121
T * construct()
Constructs an object of a specific type.
Definition: ObjectData.h:102
◆ CObjectData()
| Devel::CObjectData::CObjectData |
( |
const CObjectData & |
i_oObjectData | ) |
|
|
inline |
Copy constructor.
- Parameters
-
| i_oObjectData | - Object to copy from. |
◆ construct()
template<typename T = void>
| T* Devel::CObjectData::construct |
( |
| ) |
|
|
inline |
Constructs an object of a specific type.
- Template Parameters
-
| T | - The type of object to construct. |
- Returns
- A raw pointer to the constructed object.
◆ constructor()
| Constructor Devel::CObjectData::constructor |
( |
| ) |
const |
|
inline |
Getter for m_fnClassConstructor.
- Returns
- The constructor function of the class.
◆ constructorShared()
| ConstructorShared Devel::CObjectData::constructorShared |
( |
| ) |
const |
|
inline |
Getter for m_fnClassConstructorShared.
- Returns
- The shared constructor function of the class.
◆ constructShared()
template<typename T = void>
| std::shared_ptr<T> Devel::CObjectData::constructShared |
( |
| ) |
|
|
inline |
Constructs an object of a specific type.
- Template Parameters
-
| T | - The type of object to construct. |
- Returns
- A shared pointer to the constructed object.
◆ deconstruct()
template<typename T = void>
| void Devel::CObjectData::deconstruct |
( |
T * |
i_tData | ) |
|
|
inline |
Deconstructs an object of a specific type.
- Template Parameters
-
| T | - The type of the object to deconstruct. |
- Parameters
-
| i_tData | - Pointer to the object to deconstruct. |
◆ deconstructor()
| Deconstructor Devel::CObjectData::deconstructor |
( |
| ) |
const |
|
inline |
Getter for m_fnClassDeconstructor.
- Returns
- The deconstructor function of the class.
◆ get()
Static function for creating CObjectData for a specific type.
- Template Parameters
-
| T | - The type for which the CObjectData is to be created. |
- Returns
- CObjectData instance corresponding to the given type.
◆ hasVirtual()
| bool Devel::CObjectData::hasVirtual |
( |
| ) |
const |
|
inline |
Getter for m_fHasVirtual.
- Returns
- Whether the class has virtual functions.
◆ size()
| size_t Devel::CObjectData::size |
( |
| ) |
const |
|
inline |
Getter for m_nClassSize.
- Returns
- The size of the class.
The documentation for this class was generated from the following file:
- /home/runner/work/devel-library/devel-library/Core/ObjectData/ObjectData.h