MOAB: Mesh Oriented datABase  (version 5.3.1)
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 ( 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.

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

        : arrayPtr( 0 )
    {
        if( !array_allocated_space || !*array_ptr )
        {
            *array_ptr            = std::malloc( val_size * count );
            array_allocated_space = array_size = count;
            if( !*array_ptr ) { ERROR( iBase_MEMORY_ALLOCATION_FAILED, "Couldn't allocate array." ); }
            arrayPtr = array_ptr;
        }
        else
        {
            array_size = count;
            if( array_allocated_space < count )
            {
                ERROR( iBase_BAD_ARRAY_SIZE, "Allocated array not large enough to hold returned contents." );
            }
        }
        RETURN( iBase_SUCCESS );
    }

Definition at line 144 of file iMesh_MOAB.hpp.

    {
        if( arrayPtr )
        {
            std::free( *arrayPtr );
            *arrayPtr = 0;
        }
    }

Member Function Documentation

void iMeshArrayManager::keep_array ( ) [inline]

Definition at line 153 of file iMesh_MOAB.hpp.

    {
        arrayPtr = 0;
    }

Member Data Documentation

void** iMeshArrayManager::arrayPtr [private]

Definition at line 119 of file iMesh_MOAB.hpp.

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines