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

C++ PROFILE_FUNC函数代码示例

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

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



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

示例1: PROFILE_FUNC

const std::pair<std::string,std::string> ribi::trim::TriangleMeshBuilder::CreateCells() const noexcept
{
  PROFILE_FUNC();

  std::stringstream out_owner;
  out_owner
    << static_cast<int>(m_faces.size())
    << "\n(\n";

  std::stringstream out_neighbour;
  out_neighbour
    << m_faces.size()
    << "\n(\n";

  for (auto face: m_faces)
  {
    assert(face);
    assert(face->GetOwner());
    out_owner << face->GetOwner()->GetIndex() << "\n";
    if(!face->GetNeighbour())
    {
      out_neighbour << "-1\n";
    }
    else
    {
      out_neighbour << face->GetNeighbour()->GetIndex() << "\n";
    }
  }

  out_owner << ")";
  out_neighbour << ")";
  return std::make_pair(out_owner.str(),out_neighbour.str());
}
开发者ID:RLED,项目名称:ProjectRichelBilderbeek,代码行数:33,代码来源:trianglemeshbuilder.cpp


示例2: PROFILE_FUNC

        void oni_adapter_plugin::init_openni()
        {
            PROFILE_FUNC();
            openni::Version version = openni::OpenNI::getVersion();

            LOG_INFO("orbbec.ni.oni_adapter_plugin", "Initializing OpenNI v%d.%d.%d.%d",
                  version.major,
                  version.minor,
                  version.maintenance,
                  version.build);

            openni::Status rc = openni::STATUS_OK;

            openni::OpenNI::addDeviceConnectedListener(this);
            openni::OpenNI::addDeviceDisconnectedListener(this);

            rc = openni::OpenNI::initialize();

            bool successful = rc == openni::STATUS_OK;

            if (!successful)
            {
                LOG_WARN("orbbec.ni.oni_adapter_plugin", "Failed to initialize OpenNI: %s", openni::OpenNI::getExtendedError());
            }
            else
            {
                LOG_INFO("orbbec.ni.oni_adapter_plugin", "Initialized OpenNI v%d.%d.%d.%d",
                      version.major,
                      version.minor,
                      version.maintenance,
                      version.build);
            }
        }
开发者ID:OpenGlasses,项目名称:astra,代码行数:33,代码来源:oni_adapter_plugin.cpp


示例3: PROFILE_FUNC

// Returns attack odds out of 100 (the higher, the better...)
int CvSelectionGroupAI::AI_attackOdds(const CvPlot* pPlot, bool bPotentialEnemy) const
{
	PROFILE_FUNC();

	CvUnit* pAttacker;

	FAssert(getOwnerINLINE() != NO_PLAYER);

/************************************************************************************************/
/* BETTER_BTS_AI_MOD                      02/21/10                                jdog5000      */
/*                                                                                              */
/* Efficiency, Lead From Behind                                                                 */
/************************************************************************************************/
	// From Lead From Behind by UncutDragon
	// original
	//if (pPlot->getBestDefender(NO_PLAYER, getOwnerINLINE(), NULL, !bPotentialEnemy, bPotentialEnemy) == NULL)
	// modified
	if (!pPlot->hasDefender(false, NO_PLAYER, getOwnerINLINE(), NULL, !bPotentialEnemy, bPotentialEnemy))
/************************************************************************************************/
/* BETTER_BTS_AI_MOD                       END                                                  */
/************************************************************************************************/
	{
		return 100;
	}

	int iOdds = 0;
	pAttacker = AI_getBestGroupAttacker(pPlot, bPotentialEnemy, iOdds);

	if (pAttacker == NULL)
	{
		return 0;
	}

	return iOdds;
}
开发者ID:Ungomma,项目名称:Civ4-K-Mod,代码行数:36,代码来源:CvSelectionGroupAI.cpp


示例4: PROFILE_FUNC

//------------------------------------------------------------------------------------------------------
//
//  FUNCTION:   void Init2DIntList(int*** pppiList, int iSizeX, int iSizeY)
//
//  PURPOSE :   allocate and initialize a 2d array of int data
//
//------------------------------------------------------------------------------------------------------
void CvXMLLoadUtility::Init2DIntList(int*** pppiList, int iSizeX, int iSizeY)
{
	// SPEEDUP
	PROFILE_FUNC();
	int i,j;	// loop counters
	int** ppiList;

	FAssertMsg(*pppiList == NULL,"memory leak?");
	FAssertMsg(((0 < iSizeX) && (0 < iSizeY)), "list size to allocate is less than 1");
	// allocate the memory for the array of pointers to arrays of ints
	*pppiList = new int *[iSizeX];
	// set the local pointer to the newly allocated memory
	ppiList = *pppiList;

	// loop through each of the pointers
	for (i=0;i<iSizeX;i++)
	{
		// allocate a list of ints for the current pointer
		ppiList[i] = new int[iSizeY];
		// loop through all of the current pointer's ints
		for (j=0;j<iSizeY;j++)
		{
			// set the current int to zero
			ppiList[i][j] = 0;
		}
	}
}
开发者ID:Alrik2002,项目名称:Civ4-MMod,代码行数:34,代码来源:CvXMLLoadUtilityInit.cpp


示例5: ParseAndExecuteBuffer

bool ParseAndExecuteBuffer(const char* buffer, const char *bufferName)
{
	PROFILE_FUNC();
	lua_State* L = GetDefaultLuaState();

	lua_pushcfunction(L, luaCallStackError);

	PROFILE_BEGIN(luaL_loadbuffer);
	int error = luaL_loadbuffer(L, buffer, strlen(buffer), bufferName);
	PROFILE_END_(luaL_loadbuffer);

	if(error == 0)
	{
		PROFILE_BEGIN(lua_pcall);
		error = lua_pcall(L, 0, 0, -2);
	}

	if(error)
	{
		string msg = lua_tostring(L, -1);
		lua_pop(L, 1);
		if(msg.find("__UG__LUA__EMPTY__MSG__") == string::npos)
			throw(LuaError(msg.c_str()));
		else
			throw(LuaError());
	}

	return true;

}
开发者ID:miho,项目名称:ugcore,代码行数:30,代码来源:lua_util.cpp


示例6: dcsmq_poll

int     dcsmq_poll(dcsmq_t*  smq, int max_time_us){	
	PROFILE_FUNC();
	int64_t past_us = 0, start_us, now_us;
	start_us = dcsutil::time_unixtime_us();
	int nproc = 0, ntotal_proc = 0;
    dcsmq_msg_t dcmsg;
    uint64_t recvmsgid;
	while (past_us < max_time_us){
        dcmsg.buffer = (char*)smq->recvbuff;
        dcmsg.sz = smq->conf.msg_buffsz;
        recvmsgid = _dcsmq_recv_msg(smq, smq->recver, smq->session, dcmsg);
        if (recvmsgid == (uint64_t)-1){
            break;
        }
        smq->msg_cb(smq, recvmsgid, dcmsg, smq->msg_cb_ud);
        ++nproc;
		++ntotal_proc;
		if (nproc >= 16){
			now_us = dcsutil::time_unixtime_us();
			past_us +=  (now_us - start_us);
			start_us = now_us;
			nproc = 0;
		}
	}
	return ntotal_proc;
}
开发者ID:jj4jj,项目名称:adjust_reporter,代码行数:26,代码来源:dcsmq.cpp


示例7: PROFILE_FUNC

SequenceOverlapPairVector OverlapExtractorWithCorrection::getExactOverlaps(const std::string& query)
{
    PROFILE_FUNC("OverlapExtractorWithCorrection::queryOverlaps")

    SequenceOverlapPairVector raw_overlaps;

    // 
    // Get inexact overlaps between the query and uncorrected reads by direct FM-index lookups
    //
    getRawOverlapsDirect(query, &raw_overlaps);

    /*
    //
    // Get inexact overlaps between the query and uncorrected reads using the k-mer cache
    //
    // Extract new reads from the FM-index and update the cache
    extractAndUpdate(query);
    extractAndUpdate(reverseComplement(query));

    // Compute overlaps between the query sequence and the raw extracted reads
    getRawOverlapsCached(query, false, &raw_overlaps);
    getRawOverlapsCached(query, true, &raw_overlaps);
    */
    // Convert raw overlaps to corrected, exact overlaps
    SequenceOverlapPairVector out_overlaps;
    getCorrectedExactOverlaps(query, &raw_overlaps, &out_overlaps);
    return out_overlaps;
}
开发者ID:AlgoLab,项目名称:FastStringGraph,代码行数:28,代码来源:OverlapExtractorWithCorrection.cpp


示例8: PROFILE_FUNC

void CTreasurePool::DelMember(CCharEntity* PChar)
{
	PROFILE_FUNC();
	DSP_DEBUG_BREAK_IF(PChar == NULL);
	DSP_DEBUG_BREAK_IF(PChar->PTreasurePool != this);

	if(m_TreasurePoolType != TREASUREPOOL_ZONE){
		//Zone drops e.g. Dynamis DO NOT remove previous lot info. Everything else does.
		for( int i=0; i<10; i++){
			if(m_PoolItems[i].Lotters.size()>0){
				for(int j=0; j<m_PoolItems[i].Lotters.size(); j++){
					//remove their lot info
					if(PChar->id == m_PoolItems[i].Lotters[j].member->id){
						m_PoolItems[i].Lotters.erase(m_PoolItems[i].Lotters.begin()+j);
					}
				}
			}
		}
	}

	for (uint32 i = 0; i < members.size(); ++i) 
	{
		if (PChar == members.at(i))
		{
			PChar->PTreasurePool = NULL;
			members.erase(members.begin()+i);
			break;
		}
	}
	if (m_TreasurePoolType != TREASUREPOOL_ZONE && members.empty())
	{
		delete this;
		return;
	}
}
开发者ID:bluekirby0,项目名称:darkstar,代码行数:35,代码来源:treasure_pool.cpp


示例9: PROFILE_FUNC

void CMobSkillState::Clear()
{
	PROFILE_FUNC();
  CState::Clear();

  m_PMobSkill = NULL;
}
开发者ID:bluekirby0,项目名称:darkstar,代码行数:7,代码来源:mobskill_state.cpp


示例10: PROFILE_FUNC

// Align the haplotype to the reference genome represented by the BWT/SSA pair
void HapgenUtil::alignHaplotypeToReferenceBWASW(const std::string& haplotype,
        const BWTIndexSet& referenceIndex,
        HapgenAlignmentVector& outAlignments)
{
    PROFILE_FUNC("HapgenUtil::alignHaplotypesToReferenceBWASW")
    LRAlignment::LRParams params;

    params.zBest = 20;

    for(size_t i = 0; i <= 1; ++i)
    {
        LRAlignment::LRHitVector hits;
        std::string query = (i == 0) ? haplotype : reverseComplement(haplotype);
        LRAlignment::bwaswAlignment(query, referenceIndex.pBWT, referenceIndex.pSSA, params, hits);

        // Convert the hits into alignments
        for(size_t j = 0; j < hits.size(); ++j)
        {
            int q_alignment_length = hits[j].q_end - hits[j].q_start;

            // Skip non-complete alignments
            if((int)haplotype.length() == q_alignment_length)
            {
                HapgenAlignment aln(hits[j].targetID, hits[j].t_start, hits[j].length, hits[j].G, i == 1);
                outAlignments.push_back(aln);
            }
        }
    }
}
开发者ID:nathanhaigh,项目名称:sga,代码行数:30,代码来源:HapgenUtil.cpp


示例11: PROFILE_FUNC

//------------------------------------------------------------------------------------------------------
//
//  FUNCTION:   InitImprovementBonusList(CvImprovementBonusInfo** ppImprovementBonus, int iListLen)
//
//  PURPOSE :   allocate a improvement bonus struct list of iListLen size and initialize it's members
//
//------------------------------------------------------------------------------------------------------
void CvXMLLoadUtility::InitImprovementBonusList(CvImprovementBonusInfo** ppImprovementBonus, int iListLen)
{
	// SPEEDUP
	PROFILE_FUNC();
	int i;	// loop counter
	CvImprovementBonusInfo* paImprovementBonus;

	FAssertMsg(*ppImprovementBonus == NULL,"memory leak?");
	FAssertMsg((0 < iListLen),"list size to allocate is less than 1");
	// allocate memory for the bonus type pointer based on the list length parameter
	*ppImprovementBonus = new CvImprovementBonusInfo[iListLen];
	// set the local pointer to the memory we just allocated
	paImprovementBonus = *ppImprovementBonus;

	// loop through all the bonus structs
	for (i=0;i<iListLen;i++)
	{
		paImprovementBonus[i].m_bBonusMakesValid = false;

		FAssertMsg(paImprovementBonus[i].m_aiYieldChange==NULL, "mem leak");
		paImprovementBonus[i].m_aiYieldChange = new int[NUM_YIELD_TYPES];
		for (int j = 0; j < NUM_YIELD_TYPES; j++)
		{
			paImprovementBonus[i].m_aiYieldChange[j] = 0;
		}

		paImprovementBonus[i].m_iDiscoverRand = 0;
	}
}
开发者ID:mastrude,项目名称:Medieval_Tech,代码行数:36,代码来源:CvXMLLoadUtilityInit.cpp


示例12: PROFILE_FUNC

void CLinkshell::AddMember(CCharEntity* PChar, int8 type)
{
	PROFILE_FUNC();
    members.push_back(PChar);
	Sql_Query(SqlHandle,"UPDATE accounts_sessions SET linkshellid = %u , linkshellrank = %u WHERE charid = %u", this->getID(),type, PChar->id);
    PChar->PLinkshell = this;
}
开发者ID:bluekirby0,项目名称:darkstar,代码行数:7,代码来源:linkshell.cpp


示例13: PROFILE_FUNC

void CvMapGenerator::addLakes()
{
	PROFILE_FUNC();

	if (gDLL->getPythonIFace()->pythonAddLakes() && !gDLL->getPythonIFace()->pythonUsingDefaultImpl())
	{
		return; // Python override
	}

	gDLL->NiTextOut("Adding Lakes...");
	CvPlot* pLoopPlot;
	int iI;

	for (iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++)
	{
		gDLL->callUpdater();
		pLoopPlot = GC.getMapINLINE().plotByIndexINLINE(iI);
		FAssertMsg(pLoopPlot != NULL, "LoopPlot is not assigned a valid value");

		if (!(pLoopPlot->isWater()))
		{
			if (!(pLoopPlot->isCoastalLand()))
			{
				if (!(pLoopPlot->isRiver()))
				{
					if (GC.getGameINLINE().getMapRandNum(GC.getXMLval(XML_LAKE_PLOT_RAND), "addLakes") == 0)
					{
						pLoopPlot->setPlotType(PLOT_OCEAN);
					}
				}
			}
		}
	}
}
开发者ID:Nightinggale,项目名称:Medieval_Tech,代码行数:34,代码来源:CvMapGenerator.cpp


示例14: PROFILE_FUNC

void CvMap::calculateAreas()
{
	PROFILE_FUNC();
	CvPlot* pLoopPlot;
	CvArea* pArea;
	int iArea;
	int iI;

	for (iI = 0; iI < numPlotsINLINE(); iI++)
	{
		pLoopPlot = plotByIndexINLINE(iI);
		gDLL->callUpdater();
		FAssertMsg(pLoopPlot != NULL, "LoopPlot is not assigned a valid value");

		if (pLoopPlot->getArea() == FFreeList::INVALID_INDEX)
		{
			pArea = addArea();
			pArea->init(pArea->getID(), pLoopPlot->isWater());

			iArea = pArea->getID();

			pLoopPlot->setArea(iArea);

			gDLL->getFAStarIFace()->GeneratePath(&GC.getAreaFinder(), pLoopPlot->getX_INLINE(), pLoopPlot->getY_INLINE(), -1, -1, pLoopPlot->isWater(), iArea);
		}
	}
}
开发者ID:Nightinggale,项目名称:Medieval_Tech,代码行数:27,代码来源:CvMap.cpp


示例15: PolyTreeToExPolygons

void PolyTreeToExPolygons(ClipperLib::PolyTree& polytree, Slic3r::ExPolygons* expolygons)
{
    PROFILE_FUNC();
    expolygons->clear();
    for (int i = 0; i < polytree.ChildCount(); ++i)
        AddOuterPolyNodeToExPolygons(*polytree.Childs[i], expolygons);
}
开发者ID:jiripech,项目名称:Slic3r,代码行数:7,代码来源:ClipperUtils.cpp


示例16: PROFILE_FUNC

CSynthMessagePacket::CSynthMessagePacket(CCharEntity * PChar, SYNTH_MESSAGE messageID, uint16 itemID, uint8 quantity)
{
	PROFILE_FUNC();
	this->type = 0x6F;
	this->size = 0x12;

	WBUFB(data,(0x04)-4) = messageID;

	if (itemID != 0)
	{
		WBUFB(data,(0x06)-4) = quantity;
		WBUFW(data,(0x08)-4) = itemID;
	} 
		
	if( messageID == SYNTH_FAIL) 
	{
		uint8 count = 0;
		for(uint8 slotID = 1; slotID <= 8; ++slotID) 
		{
			uint32 quantity = PChar->CraftContainer->getQuantity(slotID);
			if (quantity == 0) 
			{
                uint16 itemID = PChar->CraftContainer->getItemID(slotID);
				WBUFW(data,(0x0A+(count*2))-4) = itemID;
				count++;
			}
		}
	}
}
开发者ID:bluekirby0,项目名称:darkstar,代码行数:29,代码来源:synth_message.cpp


示例17: simplify_polygons

void simplify_polygons(const Slic3r::Polygons &subject, Slic3r::ExPolygons* retval, bool preserve_collinear)
{
    PROFILE_FUNC();

    if (!preserve_collinear) {
        Polygons polygons;
        simplify_polygons(subject, &polygons, preserve_collinear);
        union_(polygons, retval);
        return;
    }
    
    // convert into Clipper polygons
    ClipperLib::Paths input_subject;
    Slic3rMultiPoints_to_ClipperPaths(subject, &input_subject);
    
    ClipperLib::PolyTree polytree;
    
    ClipperLib::Clipper c;
    c.PreserveCollinear(true);
    c.StrictlySimple(true);
    c.AddPaths(input_subject, ClipperLib::ptSubject, true);
    c.Execute(ClipperLib::ctUnion, polytree, ClipperLib::pftNonZero, ClipperLib::pftNonZero);
    
    // convert into ExPolygons
    PolyTreeToExPolygons(polytree, retval);
}
开发者ID:jiripech,项目名称:Slic3r,代码行数:26,代码来源:ClipperUtils.cpp


示例18: offset

void
offset(const Slic3r::Polygons &polygons, ClipperLib::Paths* retval, const float delta,
    ClipperLib::JoinType joinType, double miterLimit)
{
    PROFILE_FUNC();
    // read input
    ClipperLib::Paths input;
    Slic3rMultiPoints_to_ClipperPaths(polygons, &input);
    
    // scale input
    scaleClipperPolygons(input);
    
    // perform offset
    ClipperLib::ClipperOffset co;
    if (joinType == jtRound) {
        co.ArcTolerance = miterLimit * double(CLIPPER_OFFSET_SCALE);
    } else {
        co.MiterLimit = miterLimit;
    }
    {
        PROFILE_BLOCK(offset_AddPaths);
        co.AddPaths(input, joinType, ClipperLib::etClosedPolygon);
    }
    {
        PROFILE_BLOCK(offset_Execute);
        co.Execute(*retval, delta * float(CLIPPER_OFFSET_SCALE));
    }
    
    // unscale output
    unscaleClipperPolygons(*retval);
}
开发者ID:jiripech,项目名称:Slic3r,代码行数:31,代码来源:ClipperUtils.cpp


示例19: LoadDropList

    void LoadDropList()
	{
		PROFILE_FUNC();
        int32 ret = Sql_Query(SqlHandle, "SELECT dropId, itemId, type, rate FROM mob_droplist WHERE dropid < %u;", MAX_DROPID);

	    if( ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0)
	    {
		    while(Sql_NextRow(SqlHandle) == SQL_SUCCESS) 
		    {
			    uint16 DropID  = (uint16)Sql_GetUIntData(SqlHandle,0);

                if (g_pDropList[DropID] == 0)
                {
                    g_pDropList[DropID] = new DropList_t;
                }

                DropItem_t DropItem;

                DropItem.ItemID  = (uint16)Sql_GetIntData(SqlHandle,1);
                DropItem.DropType = (uint8)Sql_GetIntData(SqlHandle,2);
                DropItem.DropRate = (uint8)Sql_GetIntData(SqlHandle,3);
				
                g_pDropList[DropID]->push_back(DropItem);
		    }
	    }
    }
开发者ID:bluekirby0,项目名称:darkstar,代码行数:26,代码来源:itemutils.cpp


示例20: LoadLootList

    void LoadLootList()
	{
		PROFILE_FUNC();
		int32 ret = Sql_Query(SqlHandle, "SELECT LootDropId, itemId, rolls, lootGroupId FROM bcnm_loot WHERE LootDropId < %u;", MAX_LOOTID);

	    if( ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0)
	    {
		    while(Sql_NextRow(SqlHandle) == SQL_SUCCESS) 
		    {
			    uint16 LootID  = (uint16)Sql_GetUIntData(SqlHandle,0);

                if (g_pLootList[LootID] == 0)
                {
                    g_pLootList[LootID] = new LootList_t;
                }

                LootItem_t LootItem;

                LootItem.ItemID  = (uint16)Sql_GetIntData(SqlHandle,1);
                LootItem.Rolls = (uint16)Sql_GetIntData(SqlHandle,2);
				LootItem.LootGroupId = (uint8)Sql_GetIntData(SqlHandle,3);
				
                g_pLootList[LootID]->push_back(LootItem);
		    }
		}
    }
开发者ID:bluekirby0,项目名称:darkstar,代码行数:26,代码来源:itemutils.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ PROFILE_START函数代码示例发布时间:2022-05-30
下一篇:
C++ PROFILER_LABEL函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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