MOAB: Mesh Oriented datABase  (version 5.5.0)
ArrayManager Class Reference

#include <ArrayManager.hpp>

Public Member Functions

 ArrayManager (void **array_ptr, int &array_allocated_space, int &array_size, int count, int val_size, int *err)
 
 ~ArrayManager ()
 
void keep_array ()
 

Private Attributes

void ** arrayPtr
 

Detailed Description

Definition at line 28 of file ArrayManager.hpp.

Constructor & Destructor Documentation

◆ ArrayManager()

ArrayManager::ArrayManager ( void **  array_ptr,
int &  array_allocated_space,
int &  array_size,
int  count,
int  val_size,
int *  err 
)
inline

Definition at line 33 of file ArrayManager.hpp.

34  : arrayPtr( 0 )
35  {
36  if( !*array_ptr || !array_allocated_space )
37  {
38  *array_ptr = std::malloc( val_size * count );
39  array_allocated_space = array_size = count;
40  if( !*array_ptr )
41  {
43  return;
44  }
45  arrayPtr = array_ptr;
46  }
47  else
48  {
49  array_size = count;
50  if( array_allocated_space < count )
51  {
53  return;
54  }
55  }
56 
57  *err = iBase_SUCCESS;
58  }

References arrayPtr, iBase_BAD_ARRAY_DIMENSION, iBase_MEMORY_ALLOCATION_FAILED, and iBase_SUCCESS.

◆ ~ArrayManager()

ArrayManager::~ArrayManager ( )
inline

Definition at line 60 of file ArrayManager.hpp.

61  {
62  if( arrayPtr )
63  {
64  std::free( *arrayPtr );
65  *arrayPtr = 0;
66  }
67  }

References arrayPtr.

Member Function Documentation

◆ keep_array()

void ArrayManager::keep_array ( )
inline

Definition at line 69 of file ArrayManager.hpp.

70  {
71  arrayPtr = 0;
72  }

References arrayPtr.

Member Data Documentation

◆ arrayPtr

void** ArrayManager::arrayPtr
private

Definition at line 30 of file ArrayManager.hpp.

Referenced by ArrayManager(), keep_array(), and ~ArrayManager().


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