cgma
iGeomArrayManager Class Reference

List of all members.

Public Member Functions

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

Private Attributes

void ** arrayPtr

Detailed Description

Definition at line 127 of file iGeom_CGMA.cc.


Constructor & Destructor Documentation

iGeomArrayManager::iGeomArrayManager ( void **  array_ptr,
int &  array_allocated_space,
int &  array_size,
int  count,
int  val_size,
int *  err 
) [inline]

Definition at line 134 of file iGeom_CGMA.cc.

                                : arrayPtr(0)
  {
    if (!*array_ptr) {
      *array_ptr = 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_DIMENSION, 
          "Allocated array not large enough to hold returned contents.");
      }
    }
    RETURN(iBase_SUCCESS);
  }

Definition at line 159 of file iGeom_CGMA.cc.

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

Member Function Documentation

void iGeomArrayManager::keep_array ( ) [inline]

Definition at line 167 of file iGeom_CGMA.cc.

    { arrayPtr = 0; }

Member Data Documentation

void** iGeomArrayManager::arrayPtr [private]

Definition at line 129 of file iGeom_CGMA.cc.


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