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


C++ S1类代码示例

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


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

示例1: main

int main(int argc, char* argv[])
{
	Object* o = new Object();
	S1* s = new S1();
	const Class* c1 = s->GetClass();

	S1* s2 = c1->CreateInstance()->Cast<S1>();

	s->Cast<Object>();
 	s->Cast<B1>();
 	s->Cast<C1>();
	
	c1 = o->GetClass();
	B1* b = new B1();
	c1 = b->GetClass();
	

	g_objClassMap.add<Object>();
	g_objClassMap.add<B1>();
	g_objClassMap.add<B2>();
	g_objClassMap.add<S1>();
	g_objClassMap.add<C1>();
	B1* bb = (B1*)g_objClassMap.get<B1>()->CreateInstance();

	return 0;
}
开发者ID:ctemple,项目名称:pwutils,代码行数:26,代码来源:testrtti.cpp

示例2: callmem

void callmem() {
  S1 s;
  N(s.nospec());
  N(s.allspec());
  N(s.intspec());
  P(s.emptyspec());
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例3: time_test

void time_test(const S1& s1, const S2& s2, S3& s3, Op op, size_t n, size_t m) {
  typedef typename S1::iterator I;
  timer t;
  t.start();
  for (int i = 0; i < m; ++i)
    std::transform(s1.begin(), s1.end(), s2.begin(), s3.begin(), op);
  double time = t.stop()/(double(n) * m);
  std::cout << std::setw(6) << std::fixed << std::setprecision(2) << time << "\t";
}
开发者ID:FelixPetriconi,项目名称:stepanov-conversations-course,代码行数:9,代码来源:transformbench.cpp

示例4: bar

int bar(int n){
  int a = 0;
  a += foo(n);
  S1 S;
  a += S.r1(n);
  a += fstatic(n);
  a += ftemplate<int>(n);

  return a;
}
开发者ID:clang-ykt,项目名称:clang_trunk,代码行数:10,代码来源:target_private_codegen.cpp

示例5: bar

int bar(int n, double *ptr) {
  int a = 0;
  a += foo(n, ptr);
  S1 S;
  a += S.r1(n);
  a += fstatic(n);
  a += ftemplate<int>(n);

  return a;
}
开发者ID:ingowald,项目名称:llvm-project,代码行数:10,代码来源:nvptx_target_firstprivate_codegen.cpp

示例6: bar

// CHECK: define {{.*}}@{{.*}}bar{{.*}}
int bar(int n){
  int a = 0;

  S1 S;
  // CHECK: call {{.*}}i32 [[FS1:@.+]]([[S1]]* {{.*}}, i32 {{.*}})
  a += S.r1(n);

  // CHECK: call {{.*}}i32 [[FSTATIC:@.+]](i32 {{.*}})
  a += fstatic(n);

  // CHECK: call {{.*}}i32 [[FTEMPLATE:@.+]](i32 {{.*}})
  a += ftemplate<int>(n);

  return a;
}
开发者ID:efcs,项目名称:clang,代码行数:16,代码来源:target_parallel_num_threads_codegen.cpp

示例7: handleCollisionWith

void Zombie::handleCollisionWith(GameObject* gameObject)
{
    if (this->hp<=0) {
        this->isScheduledForRemove = true;
    }
    S1* rabit = dynamic_cast<S1*>(gameObject);


    if (rabit != NULL) {
        xSpeed = 0;
        rabit->setHp(rabit->getHp()-this->atk);
        CCBAnimationManager* animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
        animationManager->runAnimationsForSequenceNamed("attack");
    }
}
开发者ID:huangmaowwm,项目名称:miwu,代码行数:15,代码来源:Zombie.cpp

示例8: AddBoundListMatches

//////////////////////////////////////////////////////////////////////
// we have some const_casts here so we can get at the 
bool AddBoundListMatches(vector< pair<int, B1*> >& boundlist, const S1& fw, const I1& rg, int edgno, bool bGoingDown, bool bStartIn) 
{
    ASSERT(((edgno & 2) != 0) == bGoingDown);
    pair<int, int> ilr = fw.Loclohi(rg);
    
    // pull-back from any boundaries that just cross.
    if ((ilr.first <= ilr.second) && fw[ilr.first].blower && (fw[ilr.first].w == rg.lo))
        ilr.first++;
    if ((ilr.first <= ilr.second) && !fw[ilr.second].blower && (fw[ilr.second].w == rg.hi))
        ilr.second--;
        
    // deal with the inside/outside info
    ASSERT(fw.empty() || fw.front().blower);
    ASSERT(fw.empty() || !fw.back().blower);
    bool bLeftIn = (ilr.first == 0 ? false : fw[ilr.first - 1].blower);
    bool bRightIn = (ilr.second == (int)(fw.size()) - 1 ? false : !fw[ilr.second + 1].blower);
    ASSERT(bStartIn == (bGoingDown ? bRightIn : bLeftIn));
    bool bEndIn = (bGoingDown ? bLeftIn : bRightIn);

    // feed in the indexes of the entries
    if (!bGoingDown)
    {
        for (int i = ilr.first; i <= ilr.second; i++)
        {
            boundlist.push_back(pair<int, B1*>(edgno, const_cast<B1*>(&(fw[i]))));
            ASSERT(rg.Contains(fw[i].w));
        }
    }
    else
    {
        for (int i = ilr.second; i >= ilr.first; i--)
        {
            boundlist.push_back(pair<int, B1*>(edgno, const_cast<B1*>(&(fw[i]))));
            ASSERT(rg.Contains(fw[i].w));
        }
    }

    return bEndIn;
}
开发者ID:jf---,项目名称:libactp,代码行数:41,代码来源:S2weaveCell.cpp

示例9: DrawFibre

void fsvtkToolpathMapper::DrawFibre(S1& fib, I1& wrg, double z)
{
    glBegin(GL_LINE_STRIP);
    for (int i = 0; i < fib.size(); i++)
    {
        if ((i % 2) == 0)
        {
            glEnd();
            glBegin(GL_LINE_STRIP);
        }
        //P2 p = ((fib.value_type == 1) ? P2(fib[i].w, fib.wp) : P2(fib.wp, fib[i].w));
        P2 p = ((fib.ftype == 2) ? P2(fib[i].w, fib.wp) : P2(fib.wp, fib[i].w));
        glVertex3d(p.u, p.v, z);
    }

    glEnd();
}
开发者ID:jf---,项目名称:libactp,代码行数:17,代码来源:fsvtkToolpathMapper.cpp

示例10:

void S2<T>::bar ()
{
  S1<T> st;
  st.foo();
}
开发者ID:Freeaqingme,项目名称:OpenBSD,代码行数:5,代码来源:defarg4.C

示例11: rcp_impl

 static typename boost::enable_if<storages::raw_copy_possible<S1,S2>, bool >::type
 rcp_impl(S1 & s1, S2 const & s2) {s1.raw_copy_from(s2); return true;}
开发者ID:pradhanphy,项目名称:TRIQS,代码行数:2,代码来源:compound_assign.hpp

示例12: set_difference

static inline void set_difference(const S1 &src1, const S2 &src2, D &dst) {
	std::set_difference(
		src1.begin(), src1.end(), src2.begin(), src2.end(),
		std::inserter(dst, dst.begin()));
}
开发者ID:sthenc,项目名称:Aegisub,代码行数:5,代码来源:base_grid.cpp

示例13:

std::string
demo::__toString(const S1& arg)
{
  return "[" + arg.toString() + "]";
}
开发者ID:wuhua988,项目名称:icm,代码行数:5,代码来源:Hello.cpp

示例14:

 S4() : s1(s1.baz()) {}
开发者ID:AndroidMarv,项目名称:clang,代码行数:1,代码来源:constructor-initializer.cpp

示例15: bbox

 inline int bbox(dim_t axis) const
 {
     return std::max((int)first_.bbox(axis), rest_.bbox(axis));
 }
开发者ID:benedek93,项目名称:libwaveblocks-old,代码行数:4,代码来源:shape_superset.hpp


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