本文整理汇总了C++中naming::id_type::get_management_type方法的典型用法代码示例。如果您正苦于以下问题:C++ id_type::get_management_type方法的具体用法?C++ id_type::get_management_type怎么用?C++ id_type::get_management_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类naming::id_type
的用法示例。
在下文中一共展示了id_type::get_management_type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: call
static lcos::future<Result>
call(naming::id_type const& id, naming::address && addr, Ts &&... vs)
{
bool target_is_managed = false;
naming::id_type id1;
if (id.get_management_type() == naming::id_type::managed)
{
id1 = naming::id_type(id.get_gid(), naming::id_type::unmanaged);
target_is_managed = true;
}
lcos::packaged_action<Action, Result> p;
p.apply(std::move(addr), target_is_managed ? id1 : id,
std::forward<Ts>(vs)...);
// keep id alive, if needed - this allows to send the destination
// as an unmanaged id
future<Result> f = p.get_future();
if (target_is_managed)
{
typedef typename traits::detail::shared_state_ptr_for<
future<Result>
>::type shared_state_ptr;
shared_state_ptr const& state = traits::detail::get_shared_state(f);
state->set_on_completed(hpx::detail::keep_id_alive(id));
}
return f;
}
示例2: trigger_lco_event
void trigger_lco_event(naming::id_type const& id, naming::address && addr,
naming::id_type const& cont, bool move_credits)
{
typedef lcos::base_lco::set_event_action set_action;
typedef
hpx::traits::extract_action<set_action>::local_result_type
local_result_type;
typedef
hpx::traits::extract_action<set_action>::remote_result_type
remote_result_type;
if (move_credits &&
id.get_management_type() != naming::id_type::unmanaged)
{
naming::id_type target(id.get_gid(), id_type::managed_move_credit);
id.make_unmanaged();
detail::apply_impl<set_action>(
actions::typed_continuation<
local_result_type, remote_result_type>(cont),
target, std::move(addr), actions::action_priority<set_action>());
}
else
{
detail::apply_impl<set_action>(
actions::typed_continuation<
local_result_type, remote_result_type>(cont),
id, std::move(addr), actions::action_priority<set_action>());
}
}
示例3: set_lco_error
void set_lco_error(naming::id_type const& id, naming::address && addr,
std::exception_ptr const& e, bool move_credits)
{
typedef lcos::base_lco::set_exception_action set_action;
if (move_credits &&
id.get_management_type() != naming::id_type::unmanaged)
{
naming::id_type target(id.get_gid(), id_type::managed_move_credit);
id.make_unmanaged();
detail::apply_impl<set_action>(
target, std::move(addr), actions::action_priority<set_action>(), e);
}
else
{
detail::apply_impl<set_action>(
id, std::move(addr), actions::action_priority<set_action>(), e);
}
}