本文整理汇总了C++中lcos::promise类的典型用法代码示例。如果您正苦于以下问题:C++ promise类的具体用法?C++ promise怎么用?C++ promise使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了promise类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: simple_refcnt_monitor
/// Create a new component on the target locality.
explicit simple_refcnt_monitor(naming::id_type const& locality)
: base_type()
, flag_promise_()
, flag_(flag_promise_.get_future())
, locality_(naming::get_locality_from_id(locality))
{
static_cast<base_type&>(*this) =
stub_type::create_async(locality_, flag_promise_.get_id());
}
示例2: is_ready
bool is_ready()
{
// Flush pending reference counting operations on the target locality.
agas::garbage_collect(locality_);
return flag_.is_ready();
}
示例3: simple_refcnt_monitor
/// Create a new component on the target locality.
explicit simple_refcnt_monitor(
naming::id_type const& locality
)
: locality_(naming::get_locality_from_id(locality))
{
gid_ = stub_type::create_async(locality_, flag_.get_id());
}
示例4: managed_refcnt_monitor
/// Create a new component on the target locality.
explicit managed_refcnt_monitor(
naming::id_type const& locality
)
: locality_(naming::get_locality_from_id(locality))
{
this->base_type::create(locality_, flag_.get_gid());
}
示例5: managed_refcnt_monitor
/// Create a new component on the target locality.
explicit managed_refcnt_monitor(
naming::gid_type const& locality
)
: locality_(naming::get_locality_from_gid(locality)
, naming::id_type::unmanaged)
{
gid_ = stub_type::create_async(locality_, flag_.get_id());
}