lcos::future<bool, response> register_name_async( std::string const& name , naming::id_type const& id ) { // We need to modify the reference count. naming::gid_type& mutable_gid = const_cast<naming::id_type&>(id).get_gid(); naming::gid_type new_gid; // FIXME: combine incref with register_name, if needed if (naming::get_credit_from_gid(mutable_gid) != 0) { new_gid = split_credits_for_gid(mutable_gid); // Credit exhaustion - we need to get more. if (0 == naming::get_credit_from_gid(new_gid)) { BOOST_ASSERT(1 == naming::get_credit_from_gid(mutable_gid)); naming::get_agas_client().incref(new_gid, 2 * HPX_INITIAL_GLOBALCREDIT); naming::add_credit_to_gid(new_gid, HPX_INITIAL_GLOBALCREDIT); naming::add_credit_to_gid(mutable_gid, HPX_INITIAL_GLOBALCREDIT); } } else new_gid = mutable_gid; request req(symbol_ns_bind, name, new_gid); naming::id_type const target = bootstrap_symbol_namespace_id(); return stubs::symbol_namespace::service_async<bool>(target, req); }
lcos::future<naming::id_type, response> resolve_name_async( std::string const& name ) { request req(symbol_ns_resolve, name); naming::id_type const gid = bootstrap_symbol_namespace_id(); return stubs::symbol_namespace::service_async<naming::id_type>(gid, req); }
lcos::future<naming::id_type, response> unregister_name_async( std::string const& name ) { request req(symbol_ns_unbind, name); naming::id_type const target = bootstrap_symbol_namespace_id(); return stubs::symbol_namespace::service_async<naming::id_type>(target, req); }
symbol_namespace() : base_type(bootstrap_symbol_namespace_id()) {}