本文整理汇总了C++中boost::pool类的典型用法代码示例。如果您正苦于以下问题:C++ pool类的具体用法?C++ pool怎么用?C++ pool使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了pool类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: search
void search()
{
if (searched)
return;
searched = true;
Node *start_node = new (node_pool.malloc()) Node(domain.get_start_state(),
0,
0);
domain.compute_heuristic(*start_node);
goal = idastar_search(start_node);
}
开发者ID:bradlarsen,项目名称:switchback,代码行数:12,代码来源:IDAStar.hpp
示例2: new
void *VarCommand::operator new(size_t aSize)
{
return varcommandpool.malloc();
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:4,代码来源:Variable.cpp
示例3: new
void *PickupGrantUpdate::operator new(size_t aSize)
{
return killpool.malloc();
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:4,代码来源:Pickup.cpp
示例4: new
void *Weapon::operator new(size_t aSize)
{
return pool.malloc();
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:4,代码来源:WeaponOriginal.cpp
示例5: res
BoundedResult
cost_bounded_search(Node *start_node,
const Cost bound)
{
if (start_node->get_state() == domain.get_goal_state()) {
BoundedResult res(start_node);
assert(res.is_goal());
return res;
}
std::vector<Node *> succs;
domain.compute_successors(*start_node, succs, node_pool);
num_expanded += 1;
num_generated += succs.size();
#ifdef OUTPUT_SEARCH_PROGRESS
if (get_num_expanded() % 1000000 == 0) {
std::cerr << "progress update:" << std::endl;
std::cerr << get_num_expanded() << " total nodes expanded" << std::endl
<< get_num_generated() << " total nodes generated" << std::endl;
}
#endif
boost::optional<Cost> new_cutoff;
for (unsigned i = 0; i < succs.size(); i += 1) {
Node *succ = succs[i];
#ifdef IDA_STAR_CYCLE_CHECKING
if (start_node->is_descendent_of(succ)) {
node_pool.free(succ);
continue;
}
#endif
domain.compute_heuristic(*start_node, *succ);
if (succ->get_f() <= bound) {
BoundedResult res = cost_bounded_search(succ, bound);
if (res.is_goal()) {
assert(!res.is_cutoff());
assert(!res.is_failure());
return res;
}
else if (res.is_cutoff()) {
assert(!res.is_goal());
assert(!res.is_failure());
if (new_cutoff)
new_cutoff = std::min(*new_cutoff, res.get_cutoff());
else
new_cutoff = res.get_cutoff();
}
}
else {
if (new_cutoff)
new_cutoff = std::min(*new_cutoff, succ->get_f());
else
new_cutoff = succ->get_f();
}
node_pool.free(succ);
} /* end for */
if (new_cutoff) {
BoundedResult res(*new_cutoff);
assert(res.is_cutoff());
assert(!res.is_goal());
assert(!res.is_failure());
return res;
}
else {
// std::cerr << "returning failure!" << std::endl;
BoundedResult res;
assert(res.is_failure());
assert(!res.is_cutoff());
assert(!res.is_failure());
return res;
}
}
开发者ID:bradlarsen,项目名称:switchback,代码行数:83,代码来源:IDAStar.hpp
示例6: delete
void Collidable::operator delete(void *aPtr)
{
pool.free(aPtr);
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:4,代码来源:Collidable.cpp
示例7: delete
void VarInteger::operator delete(void *aPtr)
{
varintegerpool.free(aPtr);
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:4,代码来源:Variable.cpp
示例8: new
void *Spawner::operator new(size_t aSize)
{
return pool.malloc();
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:4,代码来源:Spawner.cpp
示例9: delete
void Spawner::operator delete(void *aPtr)
{
pool.free(aPtr);
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:4,代码来源:Spawner.cpp
示例10: new
void *Collidable::operator new(size_t aSize)
{
return pool.malloc();
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:4,代码来源:Collidable.cpp
示例11: delete
void Weapon::operator delete(void *aPtr)
{
pool.free(aPtr);
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:4,代码来源:WeaponOriginal.cpp
示例12: delete
void Pickup::operator delete(void *aPtr)
{
pool.free(aPtr);
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:4,代码来源:Pickup.cpp
示例13: delete
void SimpleParticle::operator delete(void* block)
{
particlePool.free(block);
}
开发者ID:a-sf-mirror,项目名称:gusanos,代码行数:4,代码来源:simple_particle.cpp
示例14: destroy
void destroy(){
if(Ptr!=NULL)Pool.destroy(Ptr);
Ptr=NULL;
}
开发者ID:HomuraVehicle,项目名称:HomuraMachine_Ontake,代码行数:4,代码来源:shared_memory.hpp
示例15:
~shared_array_memory(){Pool.destroy(Ptr);}
开发者ID:HomuraVehicle,项目名称:HomuraMachine_Ontake,代码行数:1,代码来源:shared_memory.hpp
示例16: new
void* SimpleParticle::operator new(size_t count)
{
assert(count <= sizeof(SimpleParticle));
return particlePool.malloc();
}
开发者ID:a-sf-mirror,项目名称:gusanos,代码行数:5,代码来源:simple_particle.cpp
注:本文中的boost::pool类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论