本文整理汇总了C++中request::get_iterate_names_function方法的典型用法代码示例。如果您正苦于以下问题:C++ request::get_iterate_names_function方法的具体用法?C++ request::get_iterate_names_function怎么用?C++ request::get_iterate_names_function使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类request
的用法示例。
在下文中一共展示了request::get_iterate_names_function方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iterate
// TODO: catch exceptions
response symbol_namespace::iterate(
request const& req
, error_code& ec
)
{ // {{{ iterate implementation
iterate_names_function_type f = req.get_iterate_names_function();
std::unique_lock<mutex_type> l(mutex_);
for (gid_table_type::iterator it = gids_.begin(); it != gids_.end(); ++it)
{
std::string key(it->first);
naming::gid_type gid = *(it->second);
{
util::unlock_guard<std::unique_lock<mutex_type> > ul(l);
f(key, gid);
}
// re-locate current entry
it = gids_.find(key);
}
LAGAS_(info) << "symbol_namespace::iterate";
if (&ec != &throws)
ec = make_success_code();
return response(symbol_ns_iterate_names);
} // }}}
示例2: iterate
// TODO: catch exceptions
response symbol_namespace::iterate(
request const& req
, error_code& ec
)
{ // {{{ iterate implementation
iterate_names_function_type f = req.get_iterate_names_function();
mutex_type::scoped_lock l(mutex_);
for (gid_table_type::iterator it = gids_.begin()
, end = gids_.end();
it != end; ++it)
{
f(it->first, it->second);
}
LAGAS_(info) << "symbol_namespace::iterate";
if (&ec != &throws)
ec = make_success_code();
return response(symbol_ns_iterate_names);
} // }}}