本文整理汇总了C++中Flow::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Flow::end方法的具体用法?C++ Flow::end怎么用?C++ Flow::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flow
的用法示例。
在下文中一共展示了Flow::end方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Flow Flow::operator+(Flow& s2) {
Flow result;
result=*this;
for(Flow::iterator i2=s2.begin();i2!=s2.end();++i2)
result.insert(*i2);
return result;
}
示例2: transfer
list<pair<Edge, ParProEState> > ParProAnalyzer::parProTransferFunction(const ParProEState* source) {
list<pair<Edge, ParProEState> > result;
ParProLabel sourceLabel = source->getLabel();
// compute successor EStates based on the out edges of every CFG (one per parallel component)
// for (ParProLabel::iterator i=sourceLabel.begin(); i!=sourceLabel.end(); i++) {
ROSE_ASSERT(_cfas.size() == sourceLabel.size());
for (unsigned int i=0; i<_cfas.size(); i++) {
if (_cfas[i]->contains(sourceLabel[i])) { // the artifical termination label will not be in the cfa, but has no outEdges anyways
Flow outEdges = _cfas[i]->outEdges(sourceLabel[i]);
for(Flow::iterator k=outEdges.begin(); k!=outEdges.end(); ++k) {
Edge e=*k;
// TODO: combine "feasibleAccordingToGlobalState(...)" and "transfer(...)" to avoid 2nd lookup and iteration
if (isPreciseTransition(e, source)) {
if (feasibleAccordingToGlobalState(e, source)) {
ParProEState target = transfer(source, e);
result.push_back(pair<Edge, ParProEState>(e, target));
}
} else {
// we do not know whether or not the transition can be triggered
if (_approximation==COMPONENTS_OVER_APPROX) {
// we over-approximate the global system's behavior, therefore we generate the path where the tranistion is triggered...
ParProEState target = transfer(source, e);
result.push_back(pair<Edge, ParProEState>(e, target));
// ...but also include the case where the execution stops (none of these two cases is guaranteed to be part of the actual global behavior).
Edge terminationEdge = Edge(source->getLabel()[i], _artificalTerminationLabels[i]);
terminationEdge.setAnnotation("terminate (due to approximation)");
result.push_back(pair<Edge, ParProEState>(terminationEdge, setComponentToTerminationState(i, source)));
} else if (_approximation==COMPONENTS_UNDER_APPROX) {
// under-approximation here means to simply not include transitions that may or may not be feasible
} else {
cerr << "ERROR: some parallel CFGs are ignored and a synchronization tries to communicate with one of them, however no abstraction is selected." << endl;
ROSE_ASSERT(0);
}
}
}
} // for each outgoing CFG edge of a particular parallel component's current label
} // for each parallel component of the analyzed system
return result;
}
示例3: generateCode
string PromelaCodeGenerator::generateCode(Flow& automaton, int id, EdgeAnnotationMap edgeAnnotationMap,
bool useTransitionIds, boost::unordered_map<string, int>& transitionIdMap) {
stringstream ss;
ss << "/* Process "<<id<<" */" << endl;
ss << "active proctype Proc"<<id<<"()" << endl;
ss << "{" << endl;
ss << " int state = "<<automaton.getStartLabel().getId()<<";" << endl;
ss << " do" << endl;
set<Label> visited; //TODO: maybe change to hashset
list<Label> worklist;
worklist.push_back(automaton.getStartLabel());
visited.insert(automaton.getStartLabel());
while (!worklist.empty()) {
Label label = worklist.front();
worklist.pop_front();
ss << " :: state == "<<label.getId()<<" ->" << endl;
ss << " atomic {" << endl;
ss << " if" << endl;
Flow outEdges = automaton.outEdges(label);
for (Flow::iterator i=outEdges.begin(); i!= outEdges.end(); ++i) {
ss << " :: "<<communicationDetails((*i).getAnnotation(), id, edgeAnnotationMap, useTransitionIds, transitionIdMap) << endl;
ss << " state = "<<(*i).target().getId()<<";" << endl;
if (visited.find((*i).target()) == visited.end()) {
worklist.push_back((*i).target());
visited.insert((*i).target());
}
}
ss << " fi" << endl;
ss << " }" << endl;
}
ss << " od" << endl;
ss << "}" << endl;
return ss.str();
}