本文整理汇总了C++中ActRec::getClass方法的典型用法代码示例。如果您正苦于以下问题:C++ ActRec::getClass方法的具体用法?C++ ActRec::getClass怎么用?C++ ActRec::getClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActRec
的用法示例。
在下文中一共展示了ActRec::getClass方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void Injection::execute() const {
if (m_builtin) {
ASSERT(m_callback);
// Execute function in runtime
m_callback(m_arg);
return;
}
// Execute php code piece
TypedValue retval;
VarEnv *varEnv = NULL;
ActRec *cfpSave = NULL;
ObjectData *this_ = NULL;
Class *cls = NULL;
ActRec *fp = g_vmContext->getFP();
if (fp) {
if (!fp->hasVarEnv()) {
fp->m_varEnv = VarEnv::createLazyAttach(fp);
}
varEnv = fp->m_varEnv;
cfpSave = varEnv->getCfp();
if (fp->hasThis()) {
this_ = fp->getThis();
} else if (fp->hasClass()) {
cls = fp->getClass();
}
}
// Note: For now we don't merge analysis code's class and function.
// Later we might decide to do so
g_vmContext->invokeFunc(&retval, m_unit->getMain(), Array::Create(), this_,
cls, varEnv, NULL, NULL);
if (varEnv) {
varEnv->setCfp(cfpSave);
}
}
示例2: f_get_called_class
Variant f_get_called_class() {
EagerCallerFrame cf;
ActRec* ar = cf();
if (ar) {
if (ar->hasThis()) return Variant(ar->getThis()->o_getClassName());
if (ar->hasClass()) return Variant(ar->getClass()->preClass()->name());
}
return Variant(false);
}
示例3: f_get_called_class
Variant f_get_called_class() {
CallerFrame cf;
ActRec* ar = cf();
if (ar == NULL) {
return Variant(false);
}
if (ar->hasThis()) {
ObjectData* obj = ar->getThis();
return obj->o_getClassName();
} else if (ar->hasClass()) {
return ar->getClass()->preClass()->name()->data();
} else {
return Variant(false);
}
}
示例4: HHVM_FUNCTION
Variant HHVM_FUNCTION(get_called_class) {
EagerCallerFrame cf;
ActRec* ar = cf();
if (ar) {
if (ar->hasThis()) {
return Variant(ar->getThis()->getClassName());
}
if (ar->hasClass()) {
return Variant(ar->getClass()->preClass()->name(),
Variant::StaticStrInit{});
}
}
raise_warning("get_called_class() called from outside a class");
return Variant(false);
}
示例5: f_get_called_class
Variant f_get_called_class() {
if (hhvm) {
CallerFrame cf;
ActRec* ar = cf();
if (ar == NULL) {
return Variant(false);
}
if (ar->hasThis()) {
ObjectData* obj = ar->getThis();
return obj->o_getClassName();
} else if (ar->hasClass()) {
return ar->getClass()->preClass()->name()->data();
} else {
return Variant(false);
}
} else {
CStrRef cls = FrameInjection::GetStaticClassName(
ThreadInfo::s_threadInfo.getNoCheck());
return cls.size() ? Variant(cls.get()) : Variant(false);
}
}