#include // ***************************************************************************** // * cdevContextMap::cdevContextMap : // * This is the constructor for the class and it initializes all // * data items to 0 or NULL... // ***************************************************************************** cdevContextMap::cdevContextMap ( void ) : entries(NULL), maximum(0), cnt(0) {} // ***************************************************************************** // * cdevContextMap::~cdevContextMap : // * This is the destructor for the class and it will delete any // * cdevData objects that have been allocated using new and will // * then free the array that was allocated using malloc or realloc. // ***************************************************************************** cdevContextMap::~cdevContextMap ( void ) { if(entries!=NULL) { for(int i=0; i=maximum) resize(); entries[i] = new cdevData(context); cnt++; } return i; } // ***************************************************************************** // * cdevContextMap::find : // * This method allows the caller to obtain the index of a context // * cdevData object that matches the cdevData object he provides... // * If a matching context object cannot be found, then -1 will be // * returned. // ***************************************************************************** int cdevContextMap::find ( cdevData & context ) { int i; int found; for(i=0; iasciiDump(fp); fflush(fp); } fprintf(fp, "----------------------------------------------------------\n"); fprintf(fp, " End of Diagnostic Dump of CDEV Context Map\n"); fprintf(fp, "----------------------------------------------------------\n\n"); fflush(fp); }