本文整理汇总了C++中PriorityQueue::showStructure方法的典型用法代码示例。如果您正苦于以下问题:C++ PriorityQueue::showStructure方法的具体用法?C++ PriorityQueue::showStructure怎么用?C++ PriorityQueue::showStructure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PriorityQueue
的用法示例。
在下文中一共展示了PriorityQueue::showStructure方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
case 'e': case 'E': // enqueue
testPQA.enqueue( qPriority, qProcess );
if( VERBOSE )
{
cout << " Process: " << qProcess
<< " has been enqueued with a priority of "
<< qPriority << PERIOD << endl;
}
dataChanged = true;
break;
case 'h': case 'H': // help request
ShowMenu();
break;
case 'p': case 'P': // peek at next item
testPQA.peekAtFront( dataItem );
if( VERBOSE )
{
cout << " Process: " << dataItem.process
<< " with priority: " << dataItem.priority
<< " found at front of queue." << endl;
}
break;
case 'q': case 'Q': // quit the test program
if( VERBOSE )
{
cout << " End Program Requested" << endl;
}
cout << endl;
break;
case 'x': case 'X': // create copy constructor PQ
// tempPQ constructed in code block to control scope
{
PriorityQueue<DataType> tempPQ( testPQA );
testPQC = tempPQ;
}
if( VERBOSE )
{
cout << " Test PQ \'C\' has been constructed with test PQ \'A\'."
<< endl;
}
dataChanged = true;
break;
case 'z': case 'Z': // assign to b PQ
testPQB = testPQA;
if( VERBOSE )
{
cout << " Test PQ \'A\' has been assigned to test PQ \'B\'."
<< endl;
}
dataChanged = true;
break;
default : // Invalid command
// clear to end of line in case further data input
cin.ignore( SMALL_STR_LEN, ENDLINE_CHAR );
if( VERBOSE )
{
cout << " Inactive or invalid command" << endl;
}
}
if( dataChanged )
{
testPQA.showStructure( 'A' );
testPQB.showStructure( 'B' );
testPQC.showStructure( 'C' );
}
}
while ( cmdChar != 'q' && cmdChar != 'Q' );
return 0;
}