本文整理汇总了C++中LList::PutDataAtEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ LList::PutDataAtEnd方法的具体用法?C++ LList::PutDataAtEnd怎么用?C++ LList::PutDataAtEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LList
的用法示例。
在下文中一共展示了LList::PutDataAtEnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseMemoryLeakFile
//.........这里部分代码省略.........
BTree <int> *freq = frequency.LookupTree ( lowercasesourcelocation );
if ( freq ) ((int) freq->data) ++;
else frequency.PutData ( lowercasesourcelocation, 1 );
delete lowercasesourcelocation;
}
else
{
char *lastcomma = strrchr ( thisline, ',' );
if ( lastcomma )
{
char *ssize = lastcomma+2;
int size;
char unused [32];
if( sscanf ( ssize, "%d %s", &size, unused ) == 2 )
unrecognised += size;
}
}
}
memoryfile.close ();
//
// Sort the results into a list
//
DArray <int> *sizes = combined.ConvertToDArray ();
DArray <char *> *sources = combined.ConvertIndexToDArray ();
LList <char *> sorted;
int totalsize = 0;
for ( int i = 0; i < sources->Size (); ++i )
{
char *newsource = sources->GetData (i);
int newsize = sizes->GetData (i);
totalsize += newsize;
bool inserted = false;
for ( int j = 0; j < sorted.Size (); ++j ) {
char *existingsource = sorted.GetData (j);
int existingsize = combined.GetData ( existingsource );
if ( newsize <= existingsize ) {
sorted.PutDataAtIndex ( newsource, j );
inserted = true;
break;
}
}
if ( !inserted ) sorted.PutDataAtEnd ( newsource );
}
//
// Open the output file
//
FILE *output = fopen( _outputFilename, "wt" );
//
// Print out our sorted list
//
fprintf ( output, "Total recognised memory leaks : %d Kbytes\n", int(totalsize/1024) );
fprintf ( output, "Total unrecognised memory leaks : %d Kbytes\n\n", int(unrecognised/1024) );
for ( int k = sorted.Size () - 1; k >= 0; --k )
{
char *source = sorted.GetData (k);
int size = combined.GetData ( source );
int freq = frequency.GetData ( source );
if( size > 2048 )
{
fprintf ( output, "%-95s (%d Kbytes in %d leaks)\n", source, int(size/1024), freq );
}
else
{
fprintf ( output, "%-95s (%d bytes in %d leaks)\n", source, size, freq );
}
}
//
// Clear up
fclose( output );
delete sources;
delete sizes;
}