本文整理汇总了C++中ContType::find方法的典型用法代码示例。如果您正苦于以下问题:C++ ContType::find方法的具体用法?C++ ContType::find怎么用?C++ ContType::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContType
的用法示例。
在下文中一共展示了ContType::find方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getPool
boost::shared_ptr<PoolType> getPool(std::string const& key) {
ContType::const_iterator itr = pools_.find(key);
if (itr != pools_.end())
return itr->second;
static const boost::shared_ptr<PoolType> emptyPool;
return emptyPool;
}
示例2: lock
const boost::shared_ptr<PoolType>& getPool(const std::string& key)
{
mutex::scoped_lock lock(mutex_);
ContType::const_iterator itr=pools_.find(key);
if (itr!=pools_.end())
{
return itr->second;
}
static const boost::shared_ptr<PoolType> emptyPool;
return emptyPool;
}
示例3: registerPool
bool registerPool(const ConnectionCreator<Connection>& creator,int initialSize,int maxSize)
{
mutex::scoped_lock lock(mutex_);
if (pools_.find(creator.id())==pools_.end())
{
return pools_.insert(std::make_pair(creator.id(),
boost::shared_ptr<PoolType>(new PoolType(creator,initialSize,maxSize)))).second;
}
return false;
}
示例4: getPool
std::shared_ptr<PoolType> getPool(std::string const& key)
{
#ifdef MAPNIK_THREADSAFE
std::lock_guard<std::mutex> lock(mutex_);
#endif
ContType::const_iterator itr=pools_.find(key);
if (itr!=pools_.end())
{
return itr->second;
}
static const std::shared_ptr<PoolType> emptyPool;
return emptyPool;
}
示例5: registerPool
bool registerPool(const ConnectionCreator<Connection> &creator, size_t initialSize, size_t maxSize) {
ContType::const_iterator itr = pools_.find(creator.id());
if (itr != pools_.end()) {
itr->second->set_initial_size(initialSize);
itr->second->set_max_size(maxSize);
} else
return pools_.insert(
std::make_pair(creator.id(), boost::make_shared<PoolType>(creator, initialSize,maxSize))).second;
return false;
}
示例6: registerPool
bool registerPool(ConnectionCreator<Connection> const& creator,unsigned initialSize,unsigned maxSize)
{
ContType::const_iterator itr = pools_.find(creator.id());
if (itr != pools_.end())
{
itr->second->set_initial_size(initialSize);
itr->second->set_max_size(maxSize);
}
else
{
return pools_.insert(
std::make_pair(creator.id(),
std::make_shared<PoolType>(creator,initialSize,maxSize))).second;
}
return false;
}
示例7: registerPool
bool registerPool(ConnectionCreator<Connection> const& creator,unsigned initialSize,unsigned maxSize)
{
#ifdef MAPNIK_THREADSAFE
std::lock_guard<std::mutex> lock(mutex_);
#endif
ContType::const_iterator itr = pools_.find(creator.id());
if (itr != pools_.end())
{
itr->second->set_initial_size(initialSize);
itr->second->set_max_size(maxSize);
}
else
{
return pools_.insert(
std::make_pair(creator.id(),
std::make_shared<PoolType>(creator,initialSize,maxSize))).second;
}
return false;
}