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


C++ PROFILE_FUNC函数代码示例

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


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


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