本文整理汇总了C++中TaskSet::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ TaskSet::begin方法的具体用法?C++ TaskSet::begin怎么用?C++ TaskSet::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskSet
的用法示例。
在下文中一共展示了TaskSet::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: terminateAllTasks
int TaskScheduler::terminateAllTasks()
{
TaskSet copy = runningThreads;
TaskSet::iterator it;
PRINTF(1,"Terminating all tasks\n");
for (it = copy.begin();it!=copy.end();it++) {
// delete pointer and empty the list of running tasks
terminateTask(it->second);
}
runningThreads.clear();
mainThread.reset();
return 0;
}
示例2: Visit_Node
void SchedViz::Visit_Node( const Semantics::Node &node ) {
std::string nodeName = node.name();
DBGOUT("Node: " << nodeName << std::endl)
// Add a superblock to the viz
TVSuperblock* superblock = this->_traceViz->AddSuperblock( nodeName, this->_hyperperiodSec );
// Now iterate through all of the task children
TaskSet taskSet = node.executes();
TaskSet::iterator taskIter = taskSet.begin();
for ( ; taskIter != taskSet.end(); taskIter++ ) {
// Visit the task
this->Visit_Task( *taskIter, superblock );
}
// Now interate through all of the device children
DeviceSet deviceSet = node.integrates();
DeviceSet::iterator deviceIter = deviceSet.begin();
for ( ; deviceIter != deviceSet.end(); deviceIter++ ) {
// Visit the device
this->Visit_Device( *deviceIter, superblock );
}
}
示例3: Visit_Node
void TrueTimeSourceVisitor::Visit_Node( const Semantics::Node & node ) {
// Setup the node name
std::string kernelName = node.name();
std::string kernelInitName = kernelName + "_init";
DEBUGOUT( "\tNode: " << kernelName << std::endl );
// Must be the second pass
_SchedHeaderLines.push_back( string( "// Define Schedule Offsets and Durations" ) );
_SchedHeaderLines.push_back( string( "" ) );
// Create the file name
std::string filename = std::string( node.name() ) + "_init";
// Create the hyperperiod symbol string for the node
std::string hyp_str = kernelName + "_HYPERPERIOD";
// Set some dictionary items for this node
GetMainDictionary().SetValue( "FILENAME", filename );
GetMainDictionary().SetValue( "KERNEL_SCHEDULE", "prioFP" );
GetMainDictionary().SetFormattedValue( "KERNEL_HYPERPERIOD", "%f", (double) node.hyperperiodsecs() );
GetMainDictionary().SetValue( "NODE_HYPERPERIOD_STR", hyp_str );
DeviceSet devices = node.integrates();
for ( DeviceSet::iterator devIter = devices.begin(); devIter != devices.end(); devIter++ )
{
if ( (*devIter).type() == Semantics::CommInterface::meta )
{
Semantics::CommInterface ci = Semantics::CommInterface::Cast( *devIter );
Semantics::CommMedium cm = ci.commMedium();
if ( cm != Udm::null ) {
string busname = cm.name();
AddSectionDictionary( "BUS_DEFINES" );
GetTemplateDictionary().SetValue( "BUSNAME", busname );
PopSectionDictionary();
}
}
}
if ( _SchedHeaderLines.size() < 4 )
{
ostringstream out;
out << "#define " << hyp_str << " " << (double)node.hyperperiodsecs();
_SchedHeaderLines.push_back( out.str() );
}
_already_included.clear(); // clear include list for each node
// Visit all tasks assigned to this node
TaskSet taskSet = node.executes();
TaskVector taskVector( taskSet.begin(), taskSet.end() );
TaskVector::iterator taskIter = taskVector.begin();
for ( ; taskIter != taskVector.end(); taskIter++ ){
// Visit the task
taskIter->Accept( *this );
}
// Clear the analog in/out counters
_analogIn = 1;
_analogOut = 1;
// Set up a sorted list of IChans and OChans
SortedIChan_ByChanIndex_Set ichans;
SortedOChan_ByChanIndex_Set ochans;
// Visit all devices contained in this node
DeviceSet deviceSet = node.integrates();
DeviceSet::iterator deviceIter = deviceSet.begin();
for ( ; deviceIter != deviceSet.end(); deviceIter++ ) {
// Collect all of the IChans and OChans, and keep them in the proper sorted order
// See if device is input
if ( Semantics::InputDevice::meta == (*deviceIter).type() ) {
// Cast to an InputDevice
Semantics::InputDevice input = Semantics::InputDevice::Cast( *deviceIter );
// Get the associated IChans
SortedIChan_ByChanIndex_Set iChanSet = input.inputChannels_sorted( IChanIndexSorter() );
ichans.insert( iChanSet.begin(), iChanSet.end() );
}
// See if device is output
else if ( Semantics::OutputDevice::meta == (*deviceIter).type() ) {
// Cast to an InputDevice
Semantics::OutputDevice output = Semantics::OutputDevice::Cast( *deviceIter );
// Get the associated OChans
SortedOChan_ByChanIndex_Set oChanSet = output.outputChannels_sorted( OChanIndexSorter() );
ochans.insert( oChanSet.begin(), oChanSet.end() );
}
}
// Now process the IChans and OChans in order
IChanVector iChanVector( ichans.begin(), ichans.end() );
for ( IChanVector::iterator ichanIter = iChanVector.begin(); ichanIter != iChanVector.end(); ichanIter++ )
//.........这里部分代码省略.........