• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ group类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中group的典型用法代码示例。如果您正苦于以下问题:C++ group类的具体用法?C++ group怎么用?C++ group使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了group类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: to_string

std::string to_string(const group& x) {
  if (x == invalid_group)
    return "<invalid-group>";
  std::string result = x.get()->module().name();
  result += ":";
  result += x.get()->identifier();
  return result;
}
开发者ID:crudbug,项目名称:actor-framework,代码行数:8,代码来源:group.cpp


示例2: CAF_LOG_TRACE

void local_actor::leave(const group& what) {
  CAF_LOG_TRACE(CAF_TSARG(what));
  if (what == invalid_group) {
    return;
  }
  if (detach(abstract_group::subscription_token{what.ptr()}) > 0) {
    what->unsubscribe(address());
  }
}
开发者ID:ariosx,项目名称:actor-framework,代码行数:9,代码来源:local_actor.cpp


示例3: search_reqs

bool search_reqs( group gp, const std::string &txt )
{
    return std::any_of( gp.begin(), gp.end(), [&]( const typename group::value_type & opts ) {
        return std::any_of( opts.begin(),
        opts.end(), [&]( const typename group::value_type::value_type & e ) {
            return lcmatch( e.to_string(), txt );
        } );
    } );
}
开发者ID:CIB,项目名称:Cataclysm-DDA,代码行数:9,代码来源:recipe_dictionary.cpp


示例4: join

 /// Causes this actor to subscribe to the group `what`.
 /// The group will be unsubscribed if the actor finishes execution.
 void join(const group& what) {
   CAF_LOG_TRACE(CAF_ARG(what));
   if (what == invalid_group)
     return;
   if (what->subscribe(dptr()->ctrl()))
     subscriptions_.emplace(what);
 }
开发者ID:crudbug,项目名称:actor-framework,代码行数:9,代码来源:subscriber.hpp


示例5: CPPA_LOG_TRACE

void local_actor::join(const group& what) {
    CPPA_LOG_TRACE(CPPA_TSARG(what));
    if (what && m_subscriptions.count(what) == 0) {
        CPPA_LOG_DEBUG("join group: " << to_string(what));
        m_subscriptions.insert(std::make_pair(what, what->subscribe(this)));
    }
}
开发者ID:ras0219,项目名称:libcppa,代码行数:7,代码来源:local_actor.cpp


示例6: inspect

error inspect(serializer& f, group& x) {
  std::string mod_name;
  auto ptr = x.get();
  if (!ptr)
    return f(mod_name);
  mod_name = ptr->module().name();
  auto e = f(mod_name);
  return e ? e : ptr->save(f);
}
开发者ID:crudbug,项目名称:actor-framework,代码行数:9,代码来源:group.cpp


示例7: error

inline void group::open(group const& other, std::string const& name)
{
    if (hid_ >= 0) {
        throw error("h5xx::group object is already in use");
    }

    if (exists_group(other, name)) {
        hid_ = H5Gopen(other.hid(), name.c_str(), H5P_DEFAULT);
    }
    else {
        hid_t lcpl_id = H5Pcreate(H5P_LINK_CREATE);     // create group creation property list
        H5Pset_create_intermediate_group(lcpl_id, 1);   // set intermediate link creation
        hid_ = H5Gcreate(other.hid(), name.c_str(), lcpl_id, H5P_DEFAULT, H5P_DEFAULT);
    }
    if (hid_ < 0){
        throw error("creating or opening group \"" + name + "\"");
    }
}
开发者ID:halmd-org,项目名称:h5xx,代码行数:18,代码来源:group.hpp


示例8: exists_group

/**
 * return true if group "name" exists in group "grp"
 */
inline bool exists_group(group const& grp, std::string const& name)
{
    hid_t hid = grp.hid();
    H5E_BEGIN_TRY {
        hid = H5Gopen(hid, name.c_str(), H5P_DEFAULT);
        if (hid > 0) {
            H5Gclose(hid);
        }
    } H5E_END_TRY
    return (hid > 0);
}
开发者ID:halmd-org,项目名称:h5xx,代码行数:14,代码来源:group.hpp


示例9: h5_write

 void h5_write(group g, std::string const& name, std::string const& value) {

  datatype strdatatype = H5Tcopy(H5T_C_S1);
  // auto status = H5Tset_size (strdatatype, H5T_VARIABLE);
  //auto status = H5Tset_size(strdatatype, value.size() + 1);
  H5Tset_size(strdatatype, value.size() + 1);

  dataspace space = H5Screate(H5S_SCALAR);
  dataset ds = g.create_dataset(name, strdatatype, space);

  auto err = H5Dwrite(ds, strdatatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void*)(value.c_str()));
  if (err < 0) TRIQS_RUNTIME_ERROR << "Error writing the string named" << name << " in the group" << g.name();
 }
开发者ID:JaksaVucicevic,项目名称:triqs,代码行数:13,代码来源:string.cpp


示例10: parallel_for_workitem

void parallel_for_workitem(const group<Dimensions> &g,
                           ParallelForFunctor f) {
#if defined(_OPENMP) && (!defined(TRISYCL_NO_BARRIER) && !defined(_MSC_VER))
  /* To implement barriers With OpenMP, one thread is created for each
     work-item in the group and thus an OpenMP barrier has the same effect
     of an OpenCL barrier executed by the work-items in a workgroup

     The issue is that the parallel_for_workitem() execution is slow even
     when nd_item::barrier() is not used
  */
  range<Dimensions> l_r = g.get_nd_range().get_local_range();
  id<Dimensions> id_l_r { l_r };

  auto tot = l_r.size();

  if constexpr (Dimensions == 1) {
  #pragma omp parallel for collapse(1) schedule(static) num_threads(tot)
    for (size_t i = 0; i < l_r.get(0); ++i) {
      T_Item index{g.get_nd_range()};
      index.set_local(i);
      index.set_global(index.get_local_id() + id_l_r * g.get_id());
      f(index);
    }
  } else if constexpr (Dimensions == 2) {
开发者ID:keryell,项目名称:triSYCL,代码行数:24,代码来源:parallelism.hpp


示例11: h5_read

 void h5_read(group g, std::string const& name, std::string& value) {
  dataset ds = g.open_dataset(name);
  h5::dataspace d_space = H5Dget_space(ds);
  int rank = H5Sget_simple_extent_ndims(d_space);
  if (rank != 0) TRIQS_RUNTIME_ERROR << "Reading a string and got rank !=0";
  size_t size = H5Dget_storage_size(ds);

  datatype strdatatype = H5Tcopy(H5T_C_S1);
  H5Tset_size(strdatatype, size);
  //auto status = H5Tset_size(strdatatype, size);
  // auto status = H5Tset_size (strdatatype, H5T_VARIABLE);

  std::vector<char> buf(size + 1, 0x00);
  auto err = H5Dread(ds, strdatatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf[0]);
  if (err < 0) TRIQS_RUNTIME_ERROR << "Error reading the string named" << name << " in the group" << g.name();

  value = "";
  value.append(&(buf.front()));
 }
开发者ID:JaksaVucicevic,项目名称:triqs,代码行数:19,代码来源:string.cpp


示例12: object_handle_

object::object(const group& object_) : object_handle_(object_.native_handle())
{
}
开发者ID:qbb-project,项目名称:echelon,代码行数:3,代码来源:object.cpp


示例13: assert

 ~node_graph()
 {
     assert(root_group_.child_count() == 0);
 }
开发者ID:DSastre,项目名称:supercollider,代码行数:4,代码来源:node_graph.hpp


示例14: group_ptr_

	data_callback::data_callback( group& grp )
		: group_ptr_( grp.item_mgt() )
		, owner_(grp)
	{
	}
开发者ID:dreamer-dead,项目名称:libopc,代码行数:5,代码来源:opc_data_callback.cpp


示例15: node_graph

 /** \brief ctor
  *
  * - initialize root node */
 node_graph(void):
     node_set(node_set_type::bucket_traits(node_buckets, node_set_bucket_count))
 {
     node_set.insert(root_group_);
     root_group_.add_ref();
 }
开发者ID:8c6794b6,项目名称:supercollider,代码行数:9,代码来源:node_graph.hpp


示例16: leave

 /// Causes this actor to leave the group `what`.
 void leave(const group& what) {
   CAF_LOG_TRACE(CAF_ARG(what));
   if (subscriptions_.erase(what) > 0)
     what->unsubscribe(dptr()->ctrl());
 }
开发者ID:crudbug,项目名称:actor-framework,代码行数:6,代码来源:subscriber.hpp


示例17: unmount

void unmount(const group& mount_point)
{
    hdf5::unmount(mount_point.native_handle());
}
开发者ID:qbb-project,项目名称:echelon,代码行数:4,代码来源:file.cpp


示例18: mount

group mount(const file& mounted_file, const group& mount_point)
{
    return group(hdf5::mount(mounted_file.native_handle(), mount_point.native_handle()));
}
开发者ID:qbb-project,项目名称:echelon,代码行数:4,代码来源:file.cpp


示例19: fill_queue_recursive

    HOT successor_container fill_queue_recursive(group & g, successor_container const & successors_from_parent, size_t previous_activation_limit)
    {
        assert (g.has_synth_children());

        typedef server_node_list::reverse_iterator r_iterator;

        successor_container successors(successors_from_parent);

        size_t children = g.child_count();

        sequential_child_list sequential_children;
        sequential_children.reserve(g.child_synth_count);

        for (r_iterator it = g.child_nodes.rbegin(); it != g.child_nodes.rend(); ++it) {
            server_node & node = *it;

            if (node.is_synth()) {
                r_iterator end_of_node = it;
                --end_of_node; // one element behind the last
                std::size_t node_count = 1;

                // we fill the child nodes in reverse order to an array
                for(;;) {
                    sequential_children.push_back(&*it);
                    ++it;
                    if (it == g.child_nodes.rend())
                        break; // we found the beginning of this group

                    if (!it->is_synth())
                        break; // we hit a child group, later we may want to add it's nodes, too?
                    ++node_count;
                }

                --it; // we iterated one element too far, so we need to go back to the previous element
                assert(sequential_children.size() == node_count);

                auto seq_it = sequential_children.rbegin();

                int activation_limit = get_previous_activation_count(it, g.child_nodes.rend(), previous_activation_limit);

                thread_queue_item * q_item =
                    q->allocate_queue_item(queue_node(std::move(queue_node_data(static_cast<abstract_synth*>(*seq_it++))), node_count),
                                            successors, activation_limit);

                queue_node & q_node = q_item->get_job();

                // now we can add all nodes sequentially
                for(;seq_it != sequential_children.rend(); ++seq_it)
                    q_node.add_node(static_cast<abstract_synth*>(*seq_it));
                sequential_children.clear();

                assert(q_node.size() == node_count);

                /* advance successor list */
                successors = successor_container(1);
                successors[0] = q_item;

                if (activation_limit == 0)
                    q->add_initially_runnable(q_item);
                children -= node_count;
            } else {
                abstract_group & grp = static_cast<abstract_group&>(node);

                if (grp.has_synth_children()) {
                    int activation_limit = get_previous_activation_count(it, g.child_nodes.rend(), previous_activation_limit);
                    successors = fill_queue_recursive(grp, successors, activation_limit);
                }

                children -= 1;
            }
        }
        assert(children == 0);
        return successors;
    }
开发者ID:jreus,项目名称:supercollider,代码行数:74,代码来源:dependency_graph_generator.hpp


示例20: fill_queue

 void fill_queue(group & root_group)
 {
     if (root_group.has_synth_children())
         fill_queue_recursive(root_group, successor_container(0), 0);
 }
开发者ID:jreus,项目名称:supercollider,代码行数:5,代码来源:dependency_graph_generator.hpp



注:本文中的group类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ grpc_end2end_test_config类代码示例发布时间:2022-05-31
下一篇:
C++ graphicsLib类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap