7#ifndef MAIA_GENERIC_OBJECT_H_
8#define MAIA_GENERIC_OBJECT_H_
14#ifdef MAIA_EXTRA_DEBUG
41#ifdef MAIA_EXTRA_DEBUG
74#ifdef MAIA_EXTRA_DEBUG
79 : objectPointer(t), objectIsArray(isArray) {
82#ifdef MAIA_EXTRA_DEBUG
91 g_allocatedBytes += size;
92 g_maxAllocatedBytes =
mMax(g_allocatedBytes, g_maxAllocatedBytes);
98#ifdef MAIA_EXTRA_DEBUG
101 <<
", address: " << objectPointer <<
", type: " <<
typeid(objectPointer).name()
102 <<
", isArray: " << objectIsArray <<
", called by " << callingFunction <<
")...";
107 delete[] objectPointer;
109 delete objectPointer;
110 objectPointer =
nullptr;
112#ifdef MAIA_EXTRA_DEBUG
113 m_log <<
"ok" << std::endl;
class containing a generic object
static MInt objectCounter
Variables to initialize:
MBool operator<(GenericObject otherObject)
MString & getCallingFunction()
class containing a generic pointer
GenericPointer(T *const &t, MString oName, MLong size, MString function, MBool isArray, MBool isNewObject=true)
constexpr T mMax(const T &x, const T &y)
MString getMemorySize(MLong noBytes)
Returns memory size in KB, MB or GB.
void printAllocatedMemory(const MLong oldAllocatedBytes, const MString &solverName, const MPI_Comm comm)
Prints currently allocated memory.
std::basic_string< char > MString