本文整理汇总了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());
}
示例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);
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例9: PROFILE_FUNC
void CMobSkillState::Clear()
{
PROFILE_FUNC();
CState::Clear();
m_PMobSkill = NULL;
}
示例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);
}
}
}
}
示例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;
}
}
示例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;
}
示例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);
}
}
}
}
}
}
示例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);
}
}
}
示例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);
}