本文整理汇总了C++中ASObject::decRef方法的典型用法代码示例。如果您正苦于以下问题:C++ ASObject::decRef方法的具体用法?C++ ASObject::decRef怎么用?C++ ASObject::decRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASObject
的用法示例。
在下文中一共展示了ASObject::decRef方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: abstract_b
ASFUNCTIONBODY(Vector, some)
{
if (argslen < 1)
throw Class<ArgumentError>::getInstanceS("Error #1063");
if (!args[0]->is<IFunction>())
throw Class<TypeError>::getInstanceS("Error #1034");
Vector* th=static_cast<Vector*>(obj);
IFunction* f = static_cast<IFunction*>(args[0]);
ASObject* params[3];
ASObject *funcRet;
for(unsigned int i=0; i < th->size(); i++)
{
if (!th->vec[i])
continue;
params[0] = th->vec[i];
th->vec[i]->incRef();
params[1] = abstract_i(i);
params[2] = th;
th->incRef();
if(argslen==1)
{
funcRet=f->call(getSys()->getNullRef(), params, 3);
}
else
{
args[1]->incRef();
funcRet=f->call(args[1], params, 3);
}
if(funcRet)
{
if(Boolean_concrete(funcRet))
{
return funcRet;
}
funcRet->decRef();
}
}
return abstract_b(false);
}
示例2: abstract_b
ASFUNCTIONBODY(Vector, some)
{
if (argslen < 1)
throwError<ArgumentError>(kWrongArgumentCountError, "Vector.some", "1", Integer::toString(argslen));
if (!args[0]->is<IFunction>())
throwError<TypeError>(kCheckTypeFailedError, args[0]->getClassName(), "Function");
Vector* th=static_cast<Vector*>(obj);
IFunction* f = static_cast<IFunction*>(args[0]);
ASObject* params[3];
ASObject *funcRet;
for(unsigned int i=0; i < th->size(); i++)
{
if (!th->vec[i])
continue;
params[0] = th->vec[i];
th->vec[i]->incRef();
params[1] = abstract_i(i);
params[2] = th;
th->incRef();
if(argslen==1)
{
funcRet=f->call(getSys()->getNullRef(), params, 3);
}
else
{
args[1]->incRef();
funcRet=f->call(args[1], params, 3);
}
if(funcRet)
{
if(Boolean_concrete(funcRet))
{
return funcRet;
}
funcRet->decRef();
}
}
return abstract_b(false);
}
示例3:
ASFUNCTIONBODY(Array,filter)
{
Array* th=static_cast<Array*>(obj);
assert_and_throw(argslen==1 || argslen==2);
IFunction* f = static_cast<IFunction*>(args[0]);
ASObject* params[3];
Array* ret=Class<Array>::getInstanceS();
ASObject *funcRet;
std::map<uint32_t, data_slot>::iterator it=th->data.begin();
for(;it != th->data.end();++it)
{
assert_and_throw(it->second.type==DATA_OBJECT);
params[0] = it->second.data;
it->second.data->incRef();
params[1] = abstract_i(it->first);
params[2] = th;
th->incRef();
if(argslen==1)
{
funcRet=f->call(getSys()->getNullRef(), params, 3);
}
else
{
args[1]->incRef();
funcRet=f->call(args[1], params, 3);
}
if(funcRet)
{
if(Boolean_concrete(funcRet))
{
it->second.data->incRef();
ret->push(_MR(it->second.data));
}
funcRet->decRef();
}
}
return ret;
}
示例4:
ASFUNCTIONBODY(Array,filter)
{
Array* th=static_cast<Array*>(obj);
assert_and_throw(argslen==1 || argslen==2);
IFunction* f = static_cast<IFunction*>(args[0]);
ASObject* params[3];
Array* ret=Class<Array>::getInstanceS();
ASObject *funcRet;
for(unsigned int i=0;i<th->data.size();i++)
{
assert_and_throw(th->data[i].type==DATA_OBJECT);
params[0] = th->data[i].data;
th->data[i].data->incRef();
params[1] = abstract_i(i);
params[2] = th;
th->incRef();
if(argslen==1)
{
funcRet=f->call(new Null, params, 3);
}
else
{
args[1]->incRef();
funcRet=f->call(args[1], params, 3);
}
if(funcRet)
{
if(Boolean_concrete(funcRet))
{
th->data[i].data->incRef();
ret->push(th->data[i].data);
}
funcRet->decRef();
}
}
return ret;
}
示例5:
ASFUNCTIONBODY(Vector,forEach)
{
if (argslen < 1)
throw Class<ArgumentError>::getInstanceS("Error #1063");
if (!args[0]->is<IFunction>())
throw Class<TypeError>::getInstanceS("Error #1034");
Vector* th=static_cast<Vector*>(obj);
IFunction* f = static_cast<IFunction*>(args[0]);
ASObject* params[3];
for(unsigned int i=0; i < th->size(); i++)
{
if (!th->vec[i])
continue;
params[0] = th->vec[i];
th->vec[i]->incRef();
params[1] = abstract_i(i);
params[2] = th;
th->incRef();
ASObject *funcret;
if( argslen == 1 )
{
funcret=f->call(new Null, params, 3);
}
else
{
args[1]->incRef();
funcret=f->call(args[1], params, 3);
}
if(funcret)
funcret->decRef();
}
return NULL;
}