lasso
ArrayManager Class Reference

#include <ArrayManager.hpp>

List of all members.

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 27 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 34 of file ArrayManager.hpp.

                           : 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 61 of file ArrayManager.hpp.

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

Member Function Documentation

void ArrayManager::keep_array ( ) [inline]

Definition at line 69 of file ArrayManager.hpp.

    { arrayPtr = 0; }

Member Data Documentation

void** ArrayManager::arrayPtr [private]

Definition at line 29 of file ArrayManager.hpp.


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