Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
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 ( 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.

References arrayPtr, iBase_BAD_ARRAY_DIMENSION, iBase_MEMORY_ALLOCATION_FAILED, and iBase_SUCCESS.

        : arrayPtr( 0 )
    {
        if( !*array_ptr || !array_allocated_space )
        {
            *array_ptr            = std::malloc( val_size * count );
            array_allocated_space = array_size = count;
            if( !*array_ptr )
            {
                *err = iBase_MEMORY_ALLOCATION_FAILED;
                return;
            }
            arrayPtr = array_ptr;
        }
        else
        {
            array_size = count;
            if( array_allocated_space < count )
            {
                *err = iBase_BAD_ARRAY_DIMENSION;
                return;
            }
        }

        *err = iBase_SUCCESS;
    }

Definition at line 60 of file ArrayManager.hpp.

References arrayPtr.

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

Member Function Documentation

void ArrayManager::keep_array ( ) [inline]

Definition at line 69 of file ArrayManager.hpp.

References arrayPtr.

    {
        arrayPtr = 0;
    }

Member Data Documentation

void** ArrayManager::arrayPtr [private]

Definition at line 30 of file ArrayManager.hpp.

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

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