Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

template<class ElemT>
bool Impala::Core::Column::ColumnTem< ElemT >::Reserve ( int  newCapacity,
bool  copyData 
) [inline]

Adjust number of elements and copy old element if requested.

Definition at line 80 of file ColumnTem.h.

Referenced by Impala::Core::Column::Read().

00081     {
00082         if (newCapacity == mCapacity)
00083             return true;
00084         int common = (newCapacity > mCapacity) ? mCapacity : newCapacity;
00085         mCapacity = newCapacity;
00086         ElemT* newData = new ElemT[mCapacity];
00087         if (newData == 0)
00088         {
00089             std::cout << "ColumnTem: could not resize, no memory" << std::endl;
00090             return false;
00091         }
00092         if (copyData)
00093             for (int i=0 ; i<common ; i++)
00094                 newData[i] = mData[i];
00095         delete [] mData;
00096         mData = newData;
00097         return true;
00098     }


Generated on Fri Mar 19 11:06:47 2010 for ImpalaSrc by  doxygen 1.5.1