AlcapDAQ  1
Public Member Functions | Private Attributes
MqlNtupleColumn< T > Class Template Reference

#include <MqlNtupleColumn.h>

Public Member Functions

 MqlNtupleColumn ()
 
 ~MqlNtupleColumn ()
 
T & operator[] (int i)
 
void realloc (int newSize)
 

Private Attributes

T * fArray
 
int fAllocation
 

Detailed Description

template<typename T>
class MqlNtupleColumn< T >

Definition at line 12 of file MqlNtupleColumn.h.

Constructor & Destructor Documentation

template<typename T >
MqlNtupleColumn< T >::MqlNtupleColumn ( )
inline

Definition at line 16 of file MqlNtupleColumn.h.

References MqlNtupleColumn< T >::fAllocation, and MqlNtupleColumn< T >::fArray.

16  {
17  fArray = NULL;
18  fAllocation = 0;
19  }
template<typename T >
MqlNtupleColumn< T >::~MqlNtupleColumn ( )
inline

Definition at line 21 of file MqlNtupleColumn.h.

References MqlNtupleColumn< T >::fArray.

21  {
22  if(fArray != NULL) {
23  delete[] fArray;
24  }
25  }

Member Function Documentation

template<typename T >
T& MqlNtupleColumn< T >::operator[] ( int  i)
inline

Definition at line 27 of file MqlNtupleColumn.h.

References MqlNtupleColumn< T >::fArray, and i.

27  {
28  return fArray[i];
29  }
template<typename T >
void MqlNtupleColumn< T >::realloc ( int  newSize)
inline

Definition at line 31 of file MqlNtupleColumn.h.

References MqlNtupleColumn< T >::fAllocation, and MqlNtupleColumn< T >::fArray.

31  {
32 
33  // make a new array and put it into place
34  T *oldArray = fArray;
35  T *newArray = new T[newSize];
36  fArray = newArray;
37  int oldSize = fAllocation;
38  fAllocation = newSize;
39 
40  // copy the contents and delete the old array
41  if(oldArray != NULL) {
42  memcpy(newArray, oldArray, oldSize*sizeof(T));
43  delete[] oldArray;
44  }
45 
46  }

Field Documentation

template<typename T >
int MqlNtupleColumn< T >::fAllocation
private
template<typename T >
T* MqlNtupleColumn< T >::fArray
private

The documentation for this class was generated from the following file: