当前位置: 首页>>代码示例>>C++>>正文


C++ Spec类代码示例

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


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

示例1: init

Spec init(){
    Spec s;

    s.size = SIZE;
    s.len = LENGTH;
    s.arr = new int(s.size);
    s.shuffle = &shuffle;

    s.shuffle(s);

    return s;
}
开发者ID:halitalptekin,项目名称:cppCodes,代码行数:12,代码来源:sort.cpp

示例2: string

std::string 
Sdf_MarkerUtils<Spec>::GetMarker(
    const Spec& owner, const SdfPath& connectionPath)
{
    if (connectionPath.IsEmpty()) {
        return std::string();
    }

    const SdfLayerHandle layer = owner.GetLayer();
    const SdfPath specPath = owner.GetPath().AppendTarget(connectionPath);
    return layer->GetFieldAs<std::string>(specPath, SdfFieldKeys->Marker);
}
开发者ID:400dama,项目名称:USD,代码行数:12,代码来源:markerUtils.cpp

示例3: TF_FOR_ALL

SdfPathVector 
Sdf_MarkerUtils<Spec>::GetMarkerPaths(const Spec& owner)
{
    SdfPathVector paths;

    const SdfLayerHandle layer = owner.GetLayer();
    const SdfPathVector children = owner.template GetFieldAs<SdfPathVector>(
        _MarkerPolicy::GetChildFieldKey());

    TF_FOR_ALL(path, children) {
        const SdfPath targetSpecPath = owner.GetPath().AppendTarget(*path);
        if (layer->HasField(targetSpecPath, SdfFieldKeys->Marker)) {
            paths.push_back(*path);
        }
    }

    return paths;
}
开发者ID:400dama,项目名称:USD,代码行数:18,代码来源:markerUtils.cpp

示例4: create_clusterhead

  void create_clusterhead() {

    Spec spec;

    Record * representative = make_foobar_record();
    spec.it("Creates a ClusterHead", [representative](Description desc)->bool {
      double cohesion = 0.9953;
      ClusterHead ch(representative, cohesion);
      return (cohesion == ch.m_cohesion);
    });
    // Segfaults...
    //r->print();
    // segfaults, which shouldn't be...
    // Leaks, bad
    //r->clean_member_attrib_pool();
    //std::cout << "sizeof(r): " << sizeof(*r) << std::endl;
    delete representative;
  }
开发者ID:Grace,项目名称:disambiguator,代码行数:18,代码来源:test_clusterhead.cpp

示例5: sort

void sort(const char* name, void (*sort_f)(Spec&), Spec& s, bool is_print){
    if(is_print){
        cout << "First " << name << " status: ";
        display_array(s);
    }

    clock_t begin_time = clock();
    sort_f(s);
    cout << "Last " << name << " status(" << float( clock () - begin_time ) /  CLOCKS_PER_SEC << ") ";
    
    if(is_print) display_array(s);

    s.shuffle(s);
}
开发者ID:halitalptekin,项目名称:cppCodes,代码行数:14,代码来源:sort.cpp

示例6: testem_all

  void testem_all() {

    Spec spec;

    spec.it("Comparing two empty strings scores 0", [this](Description desc)->bool {
      s1 = ""; s2 = "";
      int score = jwcmp(s1, s2);
      //print_score(s1, s2, score);
      return (0 == score);
    });


    spec.it("Comparing %s with %s results in %d", [this, &spec](Description desc)->bool {
      s1 = "MATTHEW"; s2 = "XYZ";
      int score = jwcmp(s1, s2);
      sprintf(spec.buf, desc, s1.c_str(), s2.c_str(), score);
      return (0 == score);
    });

    spec.it("Comparing %s with %s results in %d", [this, &spec](Description desc)->bool {
      s1 = "MATTHEW"; s2 = "TALIN";
      int score = jwcmp(s1, s2);
      sprintf(spec.buf, desc, s1.c_str(), s2.c_str(), score);
      return (0 == score);
    });


    spec.it("Comparing %s with %s results in %d", [this, &spec](Description desc)->bool {
      s1 = "MATTHEW"; s2 = "MATHEW";
      int score = jwcmp(s1, s2);
      sprintf(spec.buf, desc, s1.c_str(), s2.c_str(), score);
      return (4 == score);
    });


    spec.it("Comparing %s with %s results in %d", [this, &spec](Description desc)->bool {
      s1 = "MATTHEW"; s2 = "MATTHEW";
      int score = jwcmp(s1, s2);
      sprintf(spec.buf, desc, s1.c_str(), s2.c_str(), score);
      return (5 == score);
    });

  }
开发者ID:Grace,项目名称:disambiguator,代码行数:43,代码来源:test_jwcmp.cpp

示例7: add_column

inline size_t Descriptor::add_column(DataType type, StringData name, DescriptorRef* subdesc,
                                     bool nullable)
{
    size_t col_ndx = m_spec->get_public_column_count();
    insert_column(col_ndx, type, name, subdesc, nullable); // Throws
    return col_ndx;
}
开发者ID:HackSteinsGate,项目名称:Dai-Hentai,代码行数:7,代码来源:descriptor.hpp

示例8: add_column_link

inline size_t Descriptor::add_column_link(DataType type, StringData name, Table& target,
                                          LinkType link_type)
{
    size_t col_ndx = m_spec->get_public_column_count();
    insert_column_link(col_ndx, type, name, target, link_type); // Throws
    return col_ndx;
}
开发者ID:HackSteinsGate,项目名称:Dai-Hentai,代码行数:7,代码来源:descriptor.hpp

示例9: lookahead

    int lookahead(void* p, int level) {
        void* const q = work.data();
        while (level >= 1) {
            for (int b = 1; b < 2; ++b) {
                spec.get_copy(q, p);
                if (spec.get_child(q, level, b) != 0) {
                    spec.destruct(q);
                    return level;
                }
                spec.destruct(q);
            }
            level = spec.get_child(p, level, 0);
        }

        return level;
    }
开发者ID:K-Sonoda,项目名称:graphillion,代码行数:16,代码来源:Lookahead.hpp

示例10: ZddLookahead

 ZddLookahead(S const& s)
         : spec(s), work(spec.datasize()) {
 }
开发者ID:K-Sonoda,项目名称:graphillion,代码行数:3,代码来源:Lookahead.hpp

示例11: destruct

 void destruct(void* p) {
     spec.destruct(p);
 }
开发者ID:K-Sonoda,项目名称:graphillion,代码行数:3,代码来源:Lookahead.hpp

示例12: get_root

 int get_root(void* p) {
     return lookahead(p, spec.get_root(p));
 }
开发者ID:K-Sonoda,项目名称:graphillion,代码行数:3,代码来源:Lookahead.hpp

示例13: datasize

 int datasize() const {
     return spec.datasize();
 }
开发者ID:K-Sonoda,项目名称:graphillion,代码行数:3,代码来源:Lookahead.hpp

示例14: get_child

 int get_child(void* p, int level, int b) {
     return lookahead(p, spec.get_child(p, level, b));
 }
开发者ID:K-Sonoda,项目名称:graphillion,代码行数:3,代码来源:Lookahead.hpp

示例15: get_copy

 void get_copy(void* to, void const* from) {
     spec.get_copy(to, from);
 }
开发者ID:K-Sonoda,项目名称:graphillion,代码行数:3,代码来源:Lookahead.hpp


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