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

#include <iMesh_MOAB.hpp>

Public Member Functions

 iMeshArrayManager (iMesh_Instance instance, void **array_ptr, int &array_allocated_space, int &array_size, int count, int val_size, int *err)
 
 ~iMeshArrayManager ()
 
void keep_array ()
 

Private Attributes

void ** arrayPtr
 

Detailed Description

Definition at line 117 of file iMesh_MOAB.hpp.

Constructor & Destructor Documentation

◆ iMeshArrayManager()

iMeshArrayManager::iMeshArrayManager ( iMesh_Instance  instance,
void **  array_ptr,
int &  array_allocated_space,
int &  array_size,
int  count,
int  val_size,
int *  err 
)
inline

Definition at line 122 of file iMesh_MOAB.hpp.

129  : arrayPtr( 0 )
130  {
131  if( !array_allocated_space || !*array_ptr )
132  {
133  *array_ptr = std::malloc( val_size * count );
134  array_allocated_space = array_size = count;
135  if( !*array_ptr )
136  {
137  ERROR( iBase_MEMORY_ALLOCATION_FAILED, "Couldn't allocate array." );
138  }
139  arrayPtr = array_ptr;
140  }
141  else
142  {
143  array_size = count;
144  if( array_allocated_space < count )
145  {
146  ERROR( iBase_BAD_ARRAY_SIZE, "Allocated array not large enough to hold returned contents." );
147  }
148  }
150  }

References ERROR, iBase_BAD_ARRAY_SIZE, iBase_MEMORY_ALLOCATION_FAILED, iBase_SUCCESS, and RETURN.

◆ ~iMeshArrayManager()

iMeshArrayManager::~iMeshArrayManager ( )
inline

Definition at line 152 of file iMesh_MOAB.hpp.

153  {
154  if( arrayPtr )
155  {
156  std::free( *arrayPtr );
157  *arrayPtr = 0;
158  }
159  }

Member Function Documentation

◆ keep_array()

void iMeshArrayManager::keep_array ( )
inline

Definition at line 161 of file iMesh_MOAB.hpp.

162  {
163  arrayPtr = 0;
164  }

Member Data Documentation

◆ arrayPtr

void** iMeshArrayManager::arrayPtr
private

Definition at line 119 of file iMesh_MOAB.hpp.


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