• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TaskContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TaskContext的典型用法代码示例。如果您正苦于以下问题:C++ TaskContext类的具体用法?C++ TaskContext怎么用?C++ TaskContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TaskContext类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: disconnectPeers

 void TaskContext::disconnectPeers( const std::string& name )
 {
     if ( _task_map.end() != _task_map.find( name ) ) {
         TaskContext* peer = _task_map.find(name)->second;
         this->removePeer(peer);
         peer->removePeer(this);
     }
 }
开发者ID:eacousineau,项目名称:rtt,代码行数:8,代码来源:TaskContext.cpp


示例2: getTaskForRow

void PooledTaskListView::listBoxItemDoubleClicked(int row, const MouseEvent&)
{
	TaskContext* handler = getTaskForRow (row);
	if (handler != nullptr)
	{
		handler->getTask().abort();
	}
}
开发者ID:haydxn,项目名称:xh_jucemodules,代码行数:8,代码来源:PooledTaskListView.cpp


示例3: PortsTestFixture

 PortsTestFixture()
 {
     tc =  new TaskContext( "root", TaskContext::Stopped );
     tce = new EventPortsTC();
     tc2 = new EventPortsTC();
     tce->setActivity( new SequentialActivity() );
     tc2->setActivity( new SequentialActivity() );
     tc->setActivity( new SimulationActivity(0.001) );
     tsim = tc->getActivity();
     stsim = tc->getActivity();
     SimulationThread::Instance()->stop();
 }
开发者ID:konradb3,项目名称:rtt,代码行数:12,代码来源:ports_test.cpp


示例4: I

void DInst::notifyDataDepViolation(DataDepViolationAt dAt, bool val)
{
  I(!(val && restartVer));
  if (restartVer==0)
    return;

  TaskContext *tc = restartVer->getTaskContext();
  if (tc)
    tc->invalidMemAccess(dataDepViolationID, dAt);
  
  restartVer->garbageCollect();
  restartVer = 0;
}
开发者ID:dilawar,项目名称:sesc,代码行数:13,代码来源:DInst.cpp


示例5: setExceptionTask

 void ExecutionEngine::setExceptionTask() {
     std::string name;
     TaskContext* tc = dynamic_cast<TaskContext*>(taskc);
     if (tc)
         name = tc->getName();
     else if (taskc)
         name = "TaskCore";
     else
         name = "GlobalEngine";
     log(Error) << "in "<<name<<": unhandled exception in sent operation." << endlog();
     if(taskc)
         taskc->exception();
 }
开发者ID:eacousineau,项目名称:rtt,代码行数:13,代码来源:ExecutionEngine.cpp


示例6: unreportComponent

bool Logger::unreportComponent( const std::string& component ) {
    TaskContext* comp = this->getPeer(component);
    if (!comp)
    {
        log(Error) << "no such component " << component << endlog();
        return false;
    }

    Ports ports   = comp->ports()->getPorts();
    for (Ports::iterator it = ports.begin(); it != ports.end() ; ++it) {
        this->unreportPort(component, (*it)->getName());
    }
    return true;
}
开发者ID:goldhoorn,项目名称:tools-logger,代码行数:14,代码来源:Logger.cpp


示例7: reportComponent

bool Logger::reportComponent( const std::string& component ) {
    // Users may add own data sources, so avoid duplicates
    //std::vector<std::string> sources                = comp->data()->getNames();
    TaskContext* comp = this->getPeer(component);
    if ( !comp )
    {
        log(Error) << "no such component " << component << endlog();
        return false;
    }

    Ports ports   = comp->ports()->getPorts();
    for (Ports::iterator it = ports.begin(); it != ports.end() ; ++it)
        this->reportPort( component, (*it)->getName() );
    return true;
}
开发者ID:goldhoorn,项目名称:tools-logger,代码行数:15,代码来源:Logger.cpp


示例8: TaskContext

void
CorbaMQueueIPCTest::setUp()
{
    // setup DataPorts: we write into mw1, the server roundtrips it to mr1
    mr1 = new InputPort<double>("mr");
    mw1 = new OutputPort<double>("mw");

    tc =  new TaskContext( "root" );
    tc->ports()->addEventPort( *mr1, boost::bind(&CorbaMQueueIPCTest::new_data_listener, this, _1) );
    tc->ports()->addPort( *mw1 );
    tc->start();

    ts2 = ts = 0;
    tp2 = tp = 0;
}
开发者ID:Sambeet161616,项目名称:rtt,代码行数:15,代码来源:corba_mqueue_ipc_test.cpp


示例9: reportPort

// report a specific connection.
bool Logger::reportPort(const std::string& component, const std::string& port ) {
    TaskContext* comp = this->getPeer(component);
    if ( !comp )
    {
        log(Error) << "no such component " << component << endlog();
        return false;
    }

    RTT::base::OutputPortInterface* writer = dynamic_cast<RTT::base::OutputPortInterface*>(comp->ports()->getPort(port));
    if ( !writer )
    {
        log(Error) << "component " << component << " does not have a port named " << port << ", or it is a read port" << endlog();
        return false;
    }

    
    std::string portname(component + "." + port);
    RTT::base::PortInterface *pi = ports()->getPort(portname);
    
    if(pi) // we are already reporting this port
    {
        log(Info) << "port " << port << " of component " << component << " is already logged" << endlog();
        return true;
    }

    // Create the corresponding read port
    RTT::base::InputPortInterface* reader = static_cast<RTT::base::InputPortInterface*>(writer->antiClone());
    reader->setName(portname);
    writer->createBufferConnection(*reader, 25);

    return addLoggingPort(reader, portname);
}
开发者ID:goldhoorn,项目名称:tools-logger,代码行数:33,代码来源:Logger.cpp


示例10:

void TaskContextListBoxModel::ItemComponent::refresh (TaskContext& context)
{
	nameLabel.setText (context.getTask().getName(), dontSendNotification);

	TaskContext::TaskState state = context.getState();

	if (state == TaskContext::taskRunning)
	{
		setProgressBarVisible(true);
	}
	else
	{
		setStateMessage (context.getStateDescription());
	}

	if (stateLabel != nullptr)
	{
		stateLabel->toFront (false);
	}
	resized ();
	repaint ();
}
开发者ID:haydxn,项目名称:xh_jucemodules,代码行数:22,代码来源:PooledTaskListView.cpp


示例11: in

    // Exactly the same as th reportPort from the Reporter component
    bool ImageDisplayComponent::addDisplayPort(std::string& component, std::string& port)
    {

        Logger::In in("ImageDisplayComponent");
        TaskContext* comp = this->getPeer(component);
        if ( !comp ) {
            log(Error) << "Could not display Component " << component <<" : no such peer."<<endlog();
            return false;
        }
        PortInterface* porti   = comp->ports()->getPort(port);
        if ( !porti ) {
            log(Error) << "Could not display Port " << port
                       <<" : no such port on Component "<<component<<"."<<endlog();
            return false;
        }
        if ( porti->connected() ) {
            this->addDisplaySource( component + "." + port, "Port", porti->connection()->getDataSource() );
            log(Info) << "Reporting port " << port <<" : ok."<<endlog();
        } else {
            // create new port temporarily
            // this port is only created with the purpose of
            // creating a connection object.
            PortInterface* ourport = porti->antiClone();
            assert(ourport);

            ConnectionInterface::shared_ptr ci = porti->createConnection( ourport );
            if ( !ci )
                ci = ourport->createConnection( porti );
            if ( !ci )
                return false;
            ci->connect();

            delete ourport;
            this->addDisplaySource( component + "." + porti->getName(), "Port", ci->getDataSource() );
            log(Info) << "Created connection for port " << porti->getName()<<" : ok."<<endlog();
        }
        return true;

    }
开发者ID:ptroja,项目名称:orocos-ocl,代码行数:40,代码来源:DisplayImageComponent.cpp


示例12: TaskContext

void
CorbaTest::setUp()
{
    // connect DataPorts
    mi = new InputPort<double>("mi");
    mo = new OutputPort<double>("mo");

    tc =  new TaskContext( "root" );
    tc->ports()->addPort( *mi );
    tc->ports()->addPort( *mo );

    t2 = 0;
    ts2 = ts = 0;
    tp2 = tp = 0;
    wait = cbcount = 0;
    is_calling = false, is_sending = false;

    addOperation("callBackPeer", &CorbaTest::callBackPeer, this,ClientThread);
    addOperation("callBackPeerOwn", &CorbaTest::callBackPeer, this,OwnThread);
}
开发者ID:pelletierts,项目名称:orocos-rtt,代码行数:20,代码来源:corba_ipc_test.cpp


示例13: taskStatusMessageChanged

void TaskThreadWithProgressWindow::taskStatusMessageChanged (TaskContext& context)
{
	setStatusMessage (context.getTask().getStatusMessage());
}
开发者ID:haydxn,项目名称:xh_jucemodules,代码行数:4,代码来源:TaskThreadWithProgressWindow.cpp


示例14: in

    int StatementProcessor::execute(const std::string& comm)
    {
        Logger::In in("StatementProcessor");
        TaskContext* taskcontext = d->tc;

        // Minor hack : also check if it was an attribute of current TC, for example,
        // if both the object and attribute with that name exist. the if
        // statement after this one would return and not give the expr parser
        // time to evaluate 'comm'.
        if ( taskcontext->provides()->getValue( comm ) ) {
                d->printResult( taskcontext->provides()->getValue( comm )->getDataSource().get(), true );
                return 0;
        }

        Parser _parser;

        Logger::log() <<Logger::Debug << "Trying ValueChange...";
        try {
            // Check if it was a method or datasource :
            DataSourceBase::shared_ptr ds = _parser.parseValueChange( comm, taskcontext );
            // methods and DS'es are processed immediately.
            if ( ds.get() != 0 ) {
                Logger::log() << "ok" << Logger::endl;
                d->printResult( ds.get(), false );
                return 0; // done here
            } else
                Logger::log() <<Logger::Debug << "no"<<Logger::endl;
        } catch ( fatal_semantic_parse_exception& pe ) { // incorr args, ...
            // way to fatal,  must be reported immediately
            Logger::log() << Logger::Debug << "fatal_semantic_parse_exception: ";
            Logger::log() << Logger::Error << pe.what() <<Logger::nl;
            return -1;
        } catch ( syntactic_parse_exception& pe ) { // wrong content after = sign etc..
            // syntactic errors must be reported immediately
            Logger::log() << Logger::Error << "syntactic_parse_exception: ";
            Logger::log() << Logger::Error << pe.what() <<Logger::nl;
            return -1;
        } catch ( parse_exception_parser_fail &pe )
            {
                // ignore, try next parser
                Logger::log() << Logger::Debug << "Ignoring ValueChange exception :"<<Logger::nl;
                Logger::log() << Logger::Debug << pe.what() <<Logger::nl;
        } catch ( parse_exception& pe ) {
            // syntactic errors must be reported immediately
            Logger::log() << Logger::Error << "parse_exception :";
            Logger::log() << Logger::Error << pe.what() <<Logger::nl;
            return -1;
        }
        Logger::log() << Logger::Debug << "Trying Expression..."<<Logger::nl;
        try {
            // Check if it was a method or datasource :
            DataSourceBase::shared_ptr ds = _parser.parseExpression( comm, taskcontext );
            // methods and DS'es are processed immediately.
            if ( ds.get() != 0 ) {
                d->printResult( ds.get(), true );
                return 0; // done here
            } else
                Logger::log() << Logger::Error << "returned zero !"<<Logger::nl;
        } catch ( syntactic_parse_exception& pe ) { // missing brace etc
            // syntactic errors must be reported immediately
            Logger::log() << Logger::Error << "syntactic_parse_exception :";
            Logger::log() << Logger::Error << pe.what() <<Logger::nl;
            return -1;
        } catch ( fatal_semantic_parse_exception& pe ) { // incorr args, ...
            // way to fatal,  must be reported immediately
            Logger::log() << Logger::Error << "fatal_semantic_parse_exception :";
            Logger::log() << Logger::Error << pe.what() <<Logger::nl;
            return -1;
        } catch ( parse_exception_parser_fail &pe ) {
                // ignore, try next parser
                Logger::log() << Logger::Debug << "Ignoring Expression exception :"<<Logger::nl;
                Logger::log() << Logger::Debug << pe.what() <<Logger::nl;
        } catch ( parse_exception& pe ) {
            // ignore, try next parser
            Logger::log() << Logger::Debug << "Ignoring Expression parse_exception :"<<Logger::nl;
            Logger::log() << Logger::Debug << pe.what() <<Logger::nl;
        }
        return -1;
    }
开发者ID:FynnGamadeyo,项目名称:rtt,代码行数:79,代码来源:StatementProcessor.cpp


示例15: cycle

void FetchEngine::realFetch(IBucket *bucket, int fetchMax)
{
  int n2Fetched=fetchMax > 0 ? fetchMax : FetchWidth;
  maxBB = BB4Cycle; // Reset the max number of BB to fetch in this cycle (decreased in processBranch)

  // This method only can be called once per cycle or the restriction of the
  // BB4Cycle would not enforced
  I(pid>=0);
  I(maxBB>0);
  I(bucket->empty());
  
  I(missInstID==0);

  Pid_t myPid = flow.currentPid();
#ifdef TASKSCALAR
  TaskContext *tc = TaskContext::getTaskContext(myPid);
  I(tc);
  GLVID *lvid = gms->findCreateLVID(tc->getVersion());
  if (lvid==0) {
    // Not enough LVIDs. Stall fetch
    I(missInstID==0);
    nDelayInst2.add(n2Fetched);
    return;
  }
  HVersion *lvidVersion = tc->getVersion(); // no duplicate
#endif

  
  do {
    nGradInsts++; // Before executePC because it can trigger a context switch

    DInst *dinst = flow.executePC();
    if (dinst == 0)
      break;

    // If we are stalled, then this instruction will issue again so we do not
    // want to count this one
#if (defined TM)
    if(transGCM->checkStall(myPid))
    {
        delete(dinst);
        dinst==0;
        break;
    }
    else
      tmReport->registerTransInstAbort(myPid,dinst->transType);
#endif
    
#ifdef TASKSCALAR
    dinst->setLVID(lvid, lvidVersion);
#endif //TASKSCALAR

    const Instruction *inst = dinst->getInst();

#if !(defined MIPS_EMUL)
    if (inst->isStore()) {
#if (defined TLS)
      dinst->getEpoch()->pendInstr();
      dinst->getEpoch()->execInstr();
#endif // (defined TLS)
    }
#endif // For !(defined MIPS_EMUL)

    instFetched(dinst);
    bucket->push(dinst);

#ifdef XACTION
    gproc->getXactionManager()->dinstFetch(dinst);
#endif

    n2Fetched--;
  
    bbSize++;
    fbSize++;
    if(inst->isBranch()) {
      szBB.sample(bbSize);
      bbSize=0;
      
      if (!processBranch(dinst, n2Fetched)) {
	break;
      }
    }

    }while(n2Fetched>0 && flow.currentPid()==myPid);

    
#ifdef TASKSCALAR
  if (!bucket->empty())
    lvid->garbageCollect();
#endif

  ushort tmp = FetchWidth - n2Fetched;

  totalnInst+=tmp;
  if( totalnInst >= nInst2Sim ) {
    MSG("stopSimulation at %lld (%lld)",totalnInst, nInst2Sim);
    osSim->stopSimulation();
  }

  nFetched.add(tmp);
//.........这里部分代码省略.........
开发者ID:hdl,项目名称:SuperTrans,代码行数:101,代码来源:FetchEngine.cpp


示例16: getTaskContext

void TaskContextViewComponent::paint (Graphics& g)
{
	TaskContext* handler = getTaskContext ();
	if (handler != nullptr)
	{

		String name = handler->getTask().getName();
		String msg = handler->getTask().getStatusMessage();

		// 		if (rowIsSelected)
		// 		{
		// 			g.setColour (Colours::darkgrey.withAlpha(0.3f));
		// 			g.fillAll ();
		// 		}

		g.setColour (Colours::black);
		Rectangle<int> area (0,0,getWidth(),getHeight());
		area = area.reduced (4);

		int halfHeight = getHeight()/2;
		g.drawFittedText(handler->getTask().getName(), getLocalBounds().withTrimmedBottom(halfHeight).reduced(4), Justification::centredLeft, 1);
		//g.drawFittedText(handler->getStateDescription(), getLocalBounds().withTrimmedTop(halfHeight).reduced(4), Justification::centredLeft, 1);

		switch (handler->getState())
		{
		case TaskContext::taskPending:
			{
				g.setColour (Colours::blue.withAlpha(0.2f));
				g.fillRect (area.reduced(2));
			}
			break;
		case TaskContext::taskRunning:
			{
				double prog = handler->getTask().getProgress();//getOverallProgress();
				g.setColour (Colours::hotpink.withAlpha(0.5f));
				g.fillRect (area.reduced(2).withTrimmedRight (roundDoubleToInt (area.getWidth() * (1 - prog))));
			}
			break;

		case TaskContext::taskCompleted:
			{
				g.setColour (Colours::green.withAlpha(0.5f));
				g.fillRect (area.reduced(2));
			}
			break;

		case TaskContext::taskAborted:
			{
				g.setColour (Colours::red.withAlpha(0.5f));
				g.fillRect (area.reduced(2));
			}
			break;

		case TaskContext::taskStarting:
			{
				g.setColour (Colours::brown.withAlpha(0.5f));
				g.fillRect (area.reduced(2));
			}
			break;

		default:;
			break;
		}



	}
}
开发者ID:haydxn,项目名称:xh_jucemodules,代码行数:68,代码来源:PooledTaskListView.cpp


示例17: taskProgressChanged

void TaskThreadWithProgressWindow::taskProgressChanged (TaskContext& context)
{
	setProgress (context.getTask().getProgress ());
}
开发者ID:haydxn,项目名称:xh_jucemodules,代码行数:4,代码来源:TaskThreadWithProgressWindow.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TaskGroup类代码示例发布时间:2022-05-31
下一篇:
C++ TaskAccessor类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap