本文整理汇总了C++中naming::id_type::get_gid方法的典型用法代码示例。如果您正苦于以下问题:C++ id_type::get_gid方法的具体用法?C++ id_type::get_gid怎么用?C++ id_type::get_gid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类naming::id_type
的用法示例。
在下文中一共展示了id_type::get_gid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply_colocated_cb
bool apply_colocated_cb(Continuation && cont,
naming::id_type const& gid, Callback&& cb, Ts&&... vs)
{
// shortcut co-location code if target already is a locality
if (naming::is_locality(gid))
{
return apply_p_cb<Action>(std::forward<Continuation>(cont), gid,
actions::action_priority<Action>(),
std::forward<Callback>(cb), std::forward<Ts>(vs)...);
}
// Attach the requested action as a continuation to a resolve_async
// call on the locality responsible for the target gid.
naming::id_type service_target(
agas::primary_namespace::get_service_instance(gid.get_gid()),
naming::id_type::unmanaged);
typedef agas::server::primary_namespace::colocate_action action_type;
using util::placeholders::_2;
return apply_continue_cb<action_type>(
util::functional::apply_continuation(
util::bind<Action>(
util::bind(util::functional::extract_locality(), _2, gid)
, std::forward<Ts>(vs)...)
, std::forward<Continuation>(cont)),
service_target, std::forward<Callback>(cb), gid.get_gid());
}
示例2: service_target
lcos::future<
typename traits::promise_local_result<
typename hpx::traits::extract_action<Action>::remote_result_type
>::type>
async_colocated(naming::id_type const& gid, Ts&&... vs)
{
// Attach the requested action as a continuation to a resolve_async
// call on the locality responsible for the target gid.
naming::id_type service_target(
agas::primary_namespace::get_service_instance(gid.get_gid())
, naming::id_type::unmanaged);
typedef
typename hpx::traits::extract_action<Action>::remote_result_type
remote_result_type;
typedef agas::server::primary_namespace::colocate_action action_type;
using util::placeholders::_2;
return detail::async_continue_r<action_type, remote_result_type>(
util::functional::async_continuation(
util::bind<Action>(
util::bind(util::functional::extract_locality(), _2, gid)
, std::forward<Ts>(vs)...)
), service_target, gid.get_gid());
}
示例3: req
typename boost::enable_if_c<
util::tuple_size<typename Action::arguments_type>::value == 1
, lcos::future<
typename traits::promise_local_result<
typename hpx::actions::extract_action<Action>::remote_result_type
>::type>
>::type
async_colocated(
naming::id_type const& gid
, Arg0 && arg0)
{
agas::request req(agas::primary_ns_resolve_gid, gid.get_gid());
naming::id_type service_target(
agas::stubs::primary_namespace::get_service_instance(gid.get_gid())
, naming::id_type::unmanaged);
typedef agas::server::primary_namespace::service_action action_type;
using util::placeholders::_2;
return async_continue<action_type>(
service_target, req
, util::functional::async_continuation(
util::bind<Action>(
util::bind(util::functional::extract_locality(gid), _2)
, std::forward<Arg0>( arg0 ))
));
}
示例4: req
typename std::enable_if<
traits::is_continuation<Continuation>::value
, bool
>::type
apply_colocated(Continuation && cont,
naming::id_type const& gid, Ts&&... vs)
{
// shortcut co-location code if target already is a locality
if (naming::is_locality(gid))
{
return apply_c<Action>(std::forward<Continuation>(cont), gid,
std::forward<Ts>(vs)...);
}
// Attach the requested action as a continuation to a resolve_async
// call on the locality responsible for the target gid.
agas::request req(agas::primary_ns_resolve_gid, gid.get_gid());
naming::id_type service_target(
agas::stubs::primary_namespace::get_service_instance(gid.get_gid()),
naming::id_type::unmanaged);
typedef agas::server::primary_namespace::service_action action_type;
using util::placeholders::_2;
return apply_continue<action_type>(
util::functional::apply_continuation(
util::bind<Action>(
util::bind(util::functional::extract_locality(), _2, gid),
std::forward<Ts>(vs)...),
std::forward<Continuation>(cont)),
service_target, req);
}
示例5: 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;
}
示例6: 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>());
}
}
示例7: migrate_to_here
naming::gid_type component_storage::migrate_to_here(
std::vector<char> const& data, naming::id_type id,
naming::address const& current_lva)
{
naming::gid_type gid(naming::detail::get_stripped_gid(id.get_gid()));
data_[gid] = data;
// rebind the object to this storage locality
naming::address addr(current_lva);
addr.address_ = 0; // invalidate lva
if (!agas::bind(launch::sync, gid, addr, this->gid_))
{
std::ostringstream strm;
strm << "failed to rebind id " << id
<< "to storage locality: " << gid_;
HPX_THROW_EXCEPTION(duplicate_component_address,
"component_storage::migrate_to_here",
strm.str());
return naming::invalid_gid;
}
id.make_unmanaged(); // we can now release the object
return naming::invalid_gid;
}
示例8: is_local_address_cached
inline bool is_local_address_cached(
naming::id_type const& gid
, error_code& ec = throws
)
{
return is_local_address_cached(gid.get_gid(), ec);
}
示例9: trigger_lco_event
void trigger_lco_event(naming::id_type const& id, naming::id_type const& cont)
{
naming::id_type target(id.get_gid(), id_type::managed_move_credit);
id.make_unmanaged();
lcos::base_lco::set_event_action set;
apply_c(set, cont, target);
}
示例10: set_lco_error
void set_lco_error(naming::id_type const& id, boost::exception_ptr const& e)
{
naming::id_type target(id.get_gid(), id_type::managed_move_credit);
id.make_unmanaged();
lcos::base_lco::set_exception_action set;
apply(set, target, e);
}
示例11: apply_colocated
bool apply_colocated(naming::id_type const& gid, Ts&&... vs)
{
// Attach the requested action as a continuation to a resolve_async
// call on the locality responsible for the target gid.
agas::request req(agas::primary_ns_resolve_gid, gid.get_gid());
naming::id_type service_target(
agas::stubs::primary_namespace::get_service_instance(gid.get_gid()),
naming::id_type::unmanaged);
typedef agas::server::primary_namespace::service_action action_type;
using util::placeholders::_2;
return apply_continue<action_type>(
util::functional::apply_continuation(
util::bind<Action>(
util::bind(util::functional::extract_locality(), _2, gid),
std::forward<Ts>(vs)...)),
service_target, req);
}
示例12: p
inline bool
apply_r_p(naming::address& addr, naming::id_type const& gid,
threads::thread_priority priority)
{
typedef typename hpx::actions::extract_action<Action>::type action_type;
// If remote, create a new parcel to be sent to the destination
// Create a new parcel with the gid, action, and arguments
parcelset::parcel p (gid.get_gid(), complement_addr<action_type>(addr),
new hpx::actions::transfer_action<action_type>(priority));
// Send the parcel through the parcel handler
hpx::applier::get_applier().get_parcel_handler().put_parcel(p);
return false; // destination is remote
}
示例13: 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);
}
}
示例14: is_service_instance
static bool is_service_instance(naming::id_type const& id)
{
return is_service_instance(id.get_gid());
}
示例15: get_service_instance
static naming::gid_type get_service_instance(naming::id_type const& dest)
{
return get_service_instance(dest.get_gid());
}