idep_NameArray Class Reference

#include <idep_namearray.h>

List of all members.

Public Member Functions

 idep_NameArray (int maxEntriesHint=0)
 ~idep_NameArray ()
int append (const char *newName)
const char * operator[] (int index) const
int length () const

Private Member Functions

 idep_NameArray (const idep_NameArray &)
idep_NameArrayoperator= (const idep_NameArray &)

Private Attributes

char ** d_array_p
int d_size
int d_length

Detailed Description

Definition at line 10 of file idep_namearray.h.


Constructor & Destructor Documentation

idep_NameArray::idep_NameArray ( const idep_NameArray  )  [private]
idep_NameArray::idep_NameArray ( int  maxEntriesHint = 0  ) 

Definition at line 24 of file idep_namea.cxx.

References d_array_p, and d_size.

00025 : d_size(maxEntriesHint > 0 ? maxEntriesHint : START_SIZE)
00026 , d_length(0)
00027 {
00028     d_array_p = new char *[d_size];
00029 } 

idep_NameArray::~idep_NameArray (  ) 

Definition at line 31 of file idep_namea.cxx.

References d_array_p, and d_length.

00032 {                                     
00033     for (int i = 0; i < d_length; ++i) {
00034         delete [] d_array_p[i];
00035     }
00036     delete [] d_array_p;
00037 }


Member Function Documentation

int idep_NameArray::append ( const char *  newName  ) 

Definition at line 39 of file idep_namea.cxx.

References d_array_p, d_length, d_size, GROW_FACTOR, and newStrCpy().

Referenced by idep_LinkDep::addDependencyFile(), idep_CompileDep::addIncludeDirectory(), idep_CompileDep::addRootFile(), idep_NameIndexMap_i::insert(), and operator<<().

00040 {
00041     if (d_length >= d_size) {
00042         int oldSize = d_size;
00043         d_size *= GROW_FACTOR;
00044         char **tmp = d_array_p;
00045         d_array_p = new char *[d_size];
00046         assert (d_array_p);
00047         memcpy (d_array_p, tmp, oldSize * sizeof *d_array_p);
00048         delete [] tmp;
00049     }
00050     assert(d_length < d_size);
00051     d_array_p[d_length++] = newStrCpy(name);
00052     return d_length - 1;
00053 }

int idep_NameArray::length (  )  const

Definition at line 60 of file idep_namea.cxx.

References d_length.

Referenced by idep_CompileDep::calculate(), idep_LinkDep_i::calculate(), idep_NameIndexMap::length(), operator<<(), and search().

00061 {
00062     return d_length;
00063 }

idep_NameArray& idep_NameArray::operator= ( const idep_NameArray  )  [private]
const char * idep_NameArray::operator[] ( int  index  )  const

Definition at line 55 of file idep_namea.cxx.

References d_array_p.

00056 {
00057     return i < d_length && i >= 0 ? d_array_p[i] : 0;
00058 }


Member Data Documentation

char** idep_NameArray::d_array_p [private]

Definition at line 11 of file idep_namearray.h.

Referenced by append(), idep_NameArray(), operator[](), and ~idep_NameArray().

int idep_NameArray::d_length [private]

Definition at line 13 of file idep_namearray.h.

Referenced by append(), length(), and ~idep_NameArray().

int idep_NameArray::d_size [private]

Definition at line 12 of file idep_namearray.h.

Referenced by append(), and idep_NameArray().


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

Generated on 19 Jan 2018 for loon by  doxygen 1.6.1