本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
});
}
示例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;
}
示例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;
}
示例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;
}
示例10: ZddLookahead
ZddLookahead(S const& s)
: spec(s), work(spec.datasize()) {
}
示例11: destruct
void destruct(void* p) {
spec.destruct(p);
}
示例12: get_root
int get_root(void* p) {
return lookahead(p, spec.get_root(p));
}
示例13: datasize
int datasize() const {
return spec.datasize();
}
示例14: get_child
int get_child(void* p, int level, int b) {
return lookahead(p, spec.get_child(p, level, b));
}
示例15: get_copy
void get_copy(void* to, void const* from) {
spec.get_copy(to, from);
}