本文整理汇总了C++中ObjectPool::size方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPool::size方法的具体用法?C++ ObjectPool::size怎么用?C++ ObjectPool::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectPool
的用法示例。
在下文中一共展示了ObjectPool::size方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: destroyObjPool
//-------------------------------------------------------------------------------------
void UDPPacketReceiver::destroyObjPool()
{
DEBUG_MSG(boost::format("UDPPacketReceiver::destroyObjPool(): size %1%.\n") %
_g_objPool.size());
_g_objPool.destroy();
}
示例2: destroyObjPool
//-------------------------------------------------------------------------------------
void TCPPacket::destroyObjPool()
{
DEBUG_MSG(fmt::format("TCPPacket::destroyObjPool(): size {}.\n",
_g_objPool.size()));
_g_objPool.destroy();
}
示例3: destroyObjPool
//-------------------------------------------------------------------------------------
void UDPPacketReceiver::destroyObjPool()
{
DEBUG_MSG(fmt::format("UDPPacketReceiver::destroyObjPool(): size {}.\n",
_g_objPool.size()));
_g_objPool.destroy();
}
示例4: destroyObjPool
//-------------------------------------------------------------------------------------
void MemoryStream::destroyObjPool()
{
DEBUG_MSG(boost::format("MemoryStream::destroyObjPool(): size %1%.\n") %
_g_objPool.size());
_g_objPool.destroy();
}
示例5: destroyObjPool
//-------------------------------------------------------------------------------------
void MemoryStream::destroyObjPool()
{
DEBUG_MSG(fmt::format("MemoryStream::destroyObjPool(): size {}.\n",
_g_objPool.size()));
_g_objPool.destroy();
}
示例6: destroyObjPool
//-------------------------------------------------------------------------------------
void Bundle::destroyObjPool()
{
DEBUG_MSG(fmt::format("Bundle::destroyObjPool(): size {}.\n",
_g_objPool.size()));
_g_objPool.destroy();
}
示例7: main
int main()
{
ObjectPool<A> pool;
pool.add(std::unique_ptr<A>(new A()));
pool.add(std::unique_ptr<A>(new A()));
std::cout << "Object pool size: " << pool.size() << std::endl;
{
auto a = pool.get();
a->print();
pool.get();
std::cout << "Object pool size: " << pool.size() << std::endl;
}
std::cout << "Object pool size: " << pool.size() << std::endl;
return 0;
}
示例8: createTexturePool
UniqueTexturePool createTexturePool() {
ObjectPool ids;
MBGL_CHECK_ERROR(glGenTextures(TextureMax, ids.data()));
assert(ids.size() == size_t(TextureMax));
return UniqueTexturePool { std::move(ids), { this } };
}