本文整理汇总了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;
}
示例2: callmem
void callmem() {
S1 s;
N(s.nospec());
N(s.allspec());
N(s.intspec());
P(s.emptyspec());
}
示例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";
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
}
示例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;
}
示例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();
}
示例10:
void S2<T>::bar ()
{
S1<T> st;
st.foo();
}
示例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;}
示例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()));
}
示例13:
std::string
demo::__toString(const S1& arg)
{
return "[" + arg.toString() + "]";
}
示例15: bbox
inline int bbox(dim_t axis) const
{
return std::max((int)first_.bbox(axis), rest_.bbox(axis));
}