当前位置: 首页>>代码示例>>C++>>正文


C++ Flow::end方法代码示例

本文整理汇总了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;
}
开发者ID:8l,项目名称:rose,代码行数:7,代码来源:Flow.C

示例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;
}
开发者ID:jollysean,项目名称:rose,代码行数:39,代码来源:ParProAnalyzer.C

示例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();
}
开发者ID:billhoffman,项目名称:rose-develop,代码行数:36,代码来源:PromelaCodeGenerator.C


注:本文中的Flow::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。