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


C++ Profiler::split方法代码示例

本文整理汇总了C++中Profiler::split方法的典型用法代码示例。如果您正苦于以下问题:C++ Profiler::split方法的具体用法?C++ Profiler::split怎么用?C++ Profiler::split使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Profiler的用法示例。


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

示例1: run

/*! @brief The sense->move main loop
 
    When signalled the thread will quickly grab the new sensor data, compute a response, 
    and then send the commands to the actionators.
 
    Note that you can not safely use the job interface in this thread, if you need to add
    jobs provide a process function for this thread, and *another* process for the behaviour 
    thread which creates the jobs.
 
 */
void SeeThinkThread::run()
{
    #if DEBUG_VERBOSITY > 0
        debug << "SeeThinkThread::run()" << endl;
    #endif
    #ifdef THREAD_SEETHINK_PROFILE
        Profiler prof = Profiler("SeeThinkThread");
    #endif
    int err = 0;
    while (err == 0 && errno != EINTR)
    {
        try
        {
            #if defined(TARGET_IS_NAOWEBOTS) or (not defined(USE_VISION))
                wait();
            #endif
            #ifdef USE_VISION
                m_nubot->m_platform->updateImage();
                *(m_nubot->m_io) << m_nubot;  //<! Raw IMAGE STREAMING (TCP)
            #endif
            
            #ifdef THREAD_SEETHINK_PROFILE
                prof.start();
            #endif
            // -----------------------------------------------------------------------------------------------------------------------------------------------------------------
            #ifdef USE_VISION
                m_nubot->m_vision->ProcessFrame(Blackboard->Image, Blackboard->Sensors, Blackboard->Actions, Blackboard->Objects);
                #ifdef THREAD_SEETHINK_PROFILE
                    prof.split("vision");
                #endif
            #endif

            double current_time = Blackboard->Sensors->GetTimestamp();
            Blackboard->TeamInfo->UpdateTime(current_time);
            Blackboard->GameInfo->UpdateTime(current_time);
            m_logrecorder->WriteData(Blackboard);

            #ifdef USE_LOCALISATION
                m_nubot->m_localisation->process(Blackboard->Sensors, Blackboard->Objects, Blackboard->GameInfo, Blackboard->TeamInfo);
                #ifdef THREAD_SEETHINK_PROFILE
                    prof.split("localisation");
                #endif
            #endif
            
            #if defined(USE_BEHAVIOUR)
                m_nubot->m_behaviour->process(Blackboard->Jobs, Blackboard->Sensors, Blackboard->Actions, Blackboard->Objects, Blackboard->GameInfo, Blackboard->TeamInfo);
                #ifdef THREAD_SEETHINK_PROFILE
                    prof.split("behaviour");
                #endif
            #endif
            
            #if DEBUG_VERBOSITY > 0
                Blackboard->Jobs->summaryTo(debug);
            #endif

            #ifdef USE_VISION

            m_nubot->m_vision->process(Blackboard->Jobs) ; //<! Networking for Vision
            m_nubot->m_platform->process(Blackboard->Jobs, m_nubot->m_io); //<! Networking for Platform
                #ifdef THREAD_SEETHINK_PROFILE
                    prof.split("vision_jobs");
                #endif
            #endif
            #ifdef USE_MOTION
                m_nubot->m_motion->process(Blackboard->Jobs);
                #ifdef THREAD_SEETHINK_PROFILE
                    prof.split("motion_jobs");
                #endif
            #endif
            // -----------------------------------------------------------------------------------------------------------------------------------------------------------------

            #ifdef THREAD_SEETHINK_PROFILE
                debug << prof;
            #endif
        }
        catch (std::exception& e)
        {
            m_nubot->unhandledExceptionHandler(e);
        }
    } 
    errorlog << "SeeThinkThread is exiting. err: " << err << " errno: " << errno << endl;
}
开发者ID:StevenNicklin,项目名称:robocup,代码行数:92,代码来源:SeeThinkThread.cpp


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