本文整理汇总了C++中ASObject::setProxyProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ ASObject::setProxyProperty方法的具体用法?C++ ASObject::setProxyProperty怎么用?C++ ASObject::setProxyProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASObject
的用法示例。
在下文中一共展示了ASObject::setProxyProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setVariableByMultiname
void Proxy::setVariableByMultiname(const multiname& name, ASObject* o, CONST_ALLOWED_FLAG allowConst)
{
//If a variable named like this already exist, use that
if(ASObject::hasPropertyByMultiname(name, true, false) || !implEnable)
{
ASObject::setVariableByMultiname(name,o,allowConst);
return;
}
//Check if there is a custom setter defined, skipping implementation to avoid recursive calls
multiname setPropertyName(NULL);
setPropertyName.name_type=multiname::NAME_STRING;
setPropertyName.name_s_id=getSys()->getUniqueStringId("setProperty");
setPropertyName.ns.push_back(nsNameAndKind(flash_proxy,NAMESPACE));
_NR<ASObject> proxySetter=getVariableByMultiname(setPropertyName,ASObject::SKIP_IMPL);
if(proxySetter.isNull())
{
ASObject::setVariableByMultiname(name,o,allowConst);
return;
}
assert_and_throw(proxySetter->getObjectType()==T_FUNCTION);
IFunction* f=static_cast<IFunction*>(proxySetter.getPtr());
ASObject* namearg = Class<ASString>::getInstanceS(name.normalizedName());
namearg->setProxyProperty(name);
ASObject* args[2];
args[0]=namearg;
args[1]=o;
//We now suppress special handling
implEnable=false;
LOG(LOG_CALLS,_("Proxy::setProperty"));
incRef();
_R<ASObject> ret=_MR( f->call(this,args,2) );
assert_and_throw(ret->is<Undefined>());
implEnable=true;
}
示例2: hasPropertyByMultiname
bool Proxy::hasPropertyByMultiname(const multiname& name, bool considerDynamic, bool considerPrototype)
{
if (name.normalizedName() == "isAttribute")
return true;
//If a variable named like this already exist, use that
bool asobject_has_property=ASObject::hasPropertyByMultiname(name, considerDynamic, considerPrototype);
if(asobject_has_property || !implEnable)
return asobject_has_property;
//Check if there is a custom hasProperty defined, skipping implementation to avoid recursive calls
multiname hasPropertyName(NULL);
hasPropertyName.name_type=multiname::NAME_STRING;
hasPropertyName.name_s_id=getSys()->getUniqueStringId("hasProperty");
hasPropertyName.ns.push_back(nsNameAndKind(flash_proxy,NAMESPACE));
_NR<ASObject> proxyHasProperty=getVariableByMultiname(hasPropertyName,ASObject::SKIP_IMPL);
if(proxyHasProperty.isNull())
{
return false;
}
assert_and_throw(proxyHasProperty->getObjectType()==T_FUNCTION);
IFunction* f=static_cast<IFunction*>(proxyHasProperty.getPtr());
ASObject* namearg = Class<ASString>::getInstanceS(name.normalizedName());
namearg->setProxyProperty(name);
ASObject* arg = namearg;
//We now suppress special handling
implEnable=false;
LOG(LOG_CALLS,_("Proxy::hasProperty"));
incRef();
_NR<ASObject> ret=_MNR(f->call(this,&arg,1));
implEnable=true;
Boolean* b = static_cast<Boolean*>(ret.getPtr());
return b->val;
}
示例3: getPropertyName
_NR<ASObject> Proxy::getVariableByMultiname(const multiname& name, GET_VARIABLE_OPTION opt)
{
//It seems that various kind of implementation works only with the empty namespace
assert_and_throw(name.ns.size()>0);
_NR<ASObject> o;
LOG(LOG_CALLS,"Proxy::getVar "<< name << " " << this->toDebugString());
if(ASObject::hasPropertyByMultiname(name, true, true) || !implEnable || (opt & ASObject::SKIP_IMPL)!=0)
o = ASObject::getVariableByMultiname(name,opt);
if (!o.isNull() || !implEnable || (opt & ASObject::SKIP_IMPL)!=0)
return o;
//Check if there is a custom getter defined, skipping implementation to avoid recursive calls
multiname getPropertyName(NULL);
getPropertyName.name_type=multiname::NAME_STRING;
getPropertyName.name_s_id=getSys()->getUniqueStringId("getProperty");
getPropertyName.ns.push_back(nsNameAndKind(flash_proxy,NAMESPACE));
o=getVariableByMultiname(getPropertyName,ASObject::SKIP_IMPL);
if(o.isNull())
return ASObject::getVariableByMultiname(name,opt);
assert_and_throw(o->getObjectType()==T_FUNCTION);
IFunction* f=static_cast<IFunction*>(o.getPtr());
ASObject* namearg = Class<ASString>::getInstanceS(name.normalizedName());
namearg->setProxyProperty(name);
ASObject* arg = namearg;
//We now suppress special handling
implEnable=false;
LOG(LOG_CALLS,"Proxy::getProperty "<< name.normalizedName() << " " << this->toDebugString());
incRef();
_NR<ASObject> ret=_MNR(f->call(this,&arg,1));
implEnable=true;
return ret;
}
示例4: deleteVariableByMultiname
bool Proxy::deleteVariableByMultiname(const multiname& name)
{
//If a variable named like this already exist, use that
if(ASObject::hasPropertyByMultiname(name, true, false) || !implEnable)
{
return ASObject::deleteVariableByMultiname(name);
}
//Check if there is a custom deleter defined, skipping implementation to avoid recursive calls
multiname deletePropertyName(NULL);
deletePropertyName.name_type=multiname::NAME_STRING;
deletePropertyName.name_s_id=getSys()->getUniqueStringId("deleteProperty");
deletePropertyName.ns.push_back(nsNameAndKind(flash_proxy,NAMESPACE));
_NR<ASObject> proxyDeleter=getVariableByMultiname(deletePropertyName,ASObject::SKIP_IMPL);
if(proxyDeleter.isNull())
{
return ASObject::deleteVariableByMultiname(name);
}
assert_and_throw(proxyDeleter->getObjectType()==T_FUNCTION);
IFunction* f=static_cast<IFunction*>(proxyDeleter.getPtr());
ASObject* namearg = Class<ASString>::getInstanceS(name.normalizedName());
namearg->setProxyProperty(name);
ASObject* arg = namearg;
//We now suppress special handling
implEnable=false;
LOG(LOG_CALLS,_("Proxy::deleteProperty"));
incRef();
_NR<ASObject> ret=_MNR(f->call(this,&arg,1));
implEnable=true;
Boolean* b = static_cast<Boolean*>(ret.getPtr());
return b->val;
}