本文整理汇总了C++中CObjRef::o_getClassName方法的典型用法代码示例。如果您正苦于以下问题:C++ CObjRef::o_getClassName方法的具体用法?C++ CObjRef::o_getClassName怎么用?C++ CObjRef::o_getClassName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CObjRef
的用法示例。
在下文中一共展示了CObjRef::o_getClassName方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: invokeStaticDirect
Variant MethodStatement::
invokeInstanceDirect(CObjRef obj, VariableEnvironment &env,
const FunctionCallExpression *caller) const {
if (getModifiers() & ClassStatement::Static) {
return invokeStaticDirect(obj->o_getClassName(), env, caller);
}
attemptAccess(FrameInjection::GetClassName(false));
DECLARE_THREAD_INFO
RECURSION_INJECTION
REQUEST_TIMEOUT_INJECTION
#ifdef HOTPROFILER
ProfilerInjection pi(info, m_fullName.c_str());
#endif
MethScopeVariableEnvironment fenv(this, 0);
directBind(env, caller, fenv);
fenv.setCurrentObject(obj);
String clsName(m_class->name().c_str(), m_class->name().size(),
AttachLiteral);
EvalFrameInjection fi(clsName, m_fullName.c_str(), fenv,
loc()->file, obj.get());
if (m_ref) {
return ref(evalBody(fenv));
}
return evalBody(fenv);
}
示例2: binary_serialize_spec
void binary_serialize_spec(CObjRef zthis, PHPOutputTransport& transport,
CArrRef spec) {
for (ArrayIter key_ptr = spec.begin(); !key_ptr.end(); ++key_ptr) {
Variant key = key_ptr.first();
if (!key.isInteger()) {
throw_tprotocolexception("Bad keytype in TSPEC (expected 'long')", INVALID_DATA);
return;
}
unsigned long fieldno = key.toInt64();
Array fieldspec = key_ptr.second().toArray();
// field name
String varname = fieldspec.rvalAt(PHPTransport::s_var,
AccessFlags::Error_Key).toString();
// thrift type
int8_t ttype = fieldspec.rvalAt(PHPTransport::s_type,
AccessFlags::Error_Key).toByte();
Variant prop = zthis->o_get(varname, true, zthis->o_getClassName());
if (!prop.isNull()) {
transport.writeI8(ttype);
transport.writeI16(fieldno);
binary_serialize(ttype, transport, prop, fieldspec);
}
}
transport.writeI8(T_STOP); // struct end
}
示例3: binary_deserialize_spec
void binary_deserialize_spec(CObjRef zthis, PHPInputTransport& transport,
CArrRef spec) {
// SET and LIST have 'elem' => array('type', [optional] 'class')
// MAP has 'val' => array('type', [optiona] 'class')
while (true) {
Variant val;
int8_t ttype = transport.readI8();
if (ttype == T_STOP) return;
int16_t fieldno = transport.readI16();
if (!(val = spec.rvalAt(fieldno)).isNull()) {
Array fieldspec = val.toArray();
// pull the field name
// zend hash tables use the null at the end in the length... so strlen(hash key) + 1.
String varname = fieldspec.rvalAt(PHPTransport::s_var).toString();
// and the type
int8_t expected_ttype = fieldspec.rvalAt(PHPTransport::s_type).toInt64();
if (ttypes_are_compatible(ttype, expected_ttype)) {
Variant rv = binary_deserialize(ttype, transport, fieldspec);
zthis->o_set(varname, rv, zthis->o_getClassName());
} else {
skip_element(ttype, transport);
}
} else {
skip_element(ttype, transport);
}
}
}
示例4: f_thrift_protocol_write_binary
void f_thrift_protocol_write_binary(CObjRef transportobj, const String& method_name,
int64_t msgtype, CObjRef request_struct,
int seqid, bool strict_write) {
PHPOutputTransport transport(transportobj);
if (strict_write) {
int32_t version = VERSION_1 | msgtype;
transport.writeI32(version);
transport.writeString(method_name.data(), method_name.size());
transport.writeI32(seqid);
} else {
transport.writeString(method_name.data(), method_name.size());
transport.writeI8(msgtype);
transport.writeI32(seqid);
}
Variant spec = HHVM_FN(hphp_get_static_property)(
request_struct->o_getClassName(),
s_TSPEC,
false);
binary_serialize_spec(request_struct, transport, spec.toArray());
transport.flush();
}
示例5: write
void VariableSerializer::write(CObjRef v) {
if (!v.isNull() && m_type == JSON) {
Array props = v->o_toArray();
ClassInfo::PropertyVec properties;
ClassInfo::GetClassProperties(properties, v->o_getClassName());
for (ClassInfo::PropertyVec::const_iterator iter = properties.begin();
iter != properties.end(); ++iter) {
if ((*iter)->attribute & ClassInfo::IsProtected) {
props.remove((*iter)->name);
}
}
// Remove private props
for (ArrayIter it(props); !it.end(); it.next()) {
if (it.first().toString().charAt(0) == '\0') {
props.remove(it.first());
}
}
setObjectInfo(v->o_getClassName(), v->o_getId());
props.serialize(this);
} else {
v.serialize(this);
}
}
示例6: write
void VariableSerializer::write(CObjRef v) {
if (!v.isNull() && m_type == JSON) {
if (incNestedLevel(v.get(), true)) {
writeOverflow(v.get(), true);
} else {
Array props(ArrayData::Create());
ClassInfo::GetArray(v.get(), v->o_getClassPropTable(), props, true);
setObjectInfo(v->o_getClassName(), v->o_getId());
props.serialize(this);
}
decNestedLevel(v.get());
} else {
v.serialize(this);
}
}
示例7: invokeInstance
Variant MethodStatement::invokeInstance(CObjRef obj, CArrRef params,
bool check /* = true */) const {
if (getModifiers() & ClassStatement::Static) {
return invokeStatic(obj->o_getClassName(), params);
}
if (check) attemptAccess(FrameInjection::GetClassName(false));
// The debug frame should have been pushed at ObjectMethodExpression
DECLARE_THREAD_INFO_NOINIT
MethScopeVariableEnvironment env(this);
env.setCurrentObject(obj);
String clsName(m_class->name());
EvalFrameInjection fi(clsName, m_fullName.c_str(), env,
loc()->file, obj.get());
if (m_ref) {
return ref(invokeImpl(env, params));
}
return invokeImpl(env, params);
}
示例8: invokeInstance
Variant MethodStatement::invokeInstance(CObjRef obj, CArrRef params,
const MethodStatementWrapper *msw, bool check /* = true */) const {
ASSERT(msw->m_methodStatement == this);
if (getModifiers() & ClassStatement::Static) {
return invokeStatic(obj->o_getClassName(), params, msw, check);
}
if (check) attemptAccess(FrameInjection::GetClassName(false), msw);
// The debug frame should have been pushed at ObjectMethodExpression
DECLARE_THREAD_INFO_NOINIT
MethScopeVariableEnvironment env(this);
env.setCurrentObject(obj);
env.setCurrentAlias(get_current_alias());
EvalFrameInjection fi(msw->m_className, m_fullName->data(), env,
loc()->file, obj.get(), FrameInjection::ObjectMethod);
if (m_ref) {
return strongBind(invokeImpl(env, params));
}
return invokeImpl(env, params);
}
示例9: invokeStaticDirect
Variant MethodStatement::
invokeInstanceDirect(CObjRef obj, VariableEnvironment &env,
const FunctionCallExpression *caller) const {
if (getModifiers() & ClassStatement::Static) {
return invokeStaticDirect(obj->o_getClassName(), env, caller);
}
attemptAccess(FrameInjection::GetClassName(false));
DECLARE_THREAD_INFO_NOINIT
MethScopeVariableEnvironment fenv(this);
directBind(env, caller, fenv);
fenv.setCurrentObject(obj);
String clsName(m_class->name());
EvalFrameInjection fi(clsName, m_fullName.c_str(), fenv,
loc()->file, obj.get());
if (m_ref) {
return ref(evalBody(fenv));
}
return evalBody(fenv);
}
示例10: invokeInstance
Variant MethodStatement::invokeInstance(CObjRef obj, CArrRef params,
bool check /* = true */) const {
if (getModifiers() & ClassStatement::Static) {
return invokeStatic(obj->o_getClassName(), params);
}
if (check) attemptAccess(FrameInjection::GetClassName(false));
// The debug frame should have been pushed at ObjectMethodExpression
DECLARE_THREAD_INFO
RECURSION_INJECTION
REQUEST_TIMEOUT_INJECTION
#ifdef HOTPROFILER
ProfilerInjection pi(info, m_fullName.c_str());
#endif
MethScopeVariableEnvironment env(this, params.size());
env.setCurrentObject(obj);
EvalFrameInjection fi(m_class->name().c_str(), m_fullName.c_str(), env,
loc()->file, obj.get());
if (m_ref) {
return ref(invokeImpl(env, params));
}
return invokeImpl(env, params);
}
示例11: invokeStaticDirect
Variant MethodStatement::
invokeInstanceDirect(CObjRef obj, CStrRef alias, VariableEnvironment &env,
const FunctionCallExpression *caller,
const MethodStatementWrapper *msw,
bool check /* = true */) const {
ASSERT(msw->m_methodStatement == this);
if (getModifiers() & ClassStatement::Static) {
return invokeStaticDirect(obj->o_getClassName(), alias, env,
caller, false, msw, check);
}
if (check) attemptAccess(FrameInjection::GetClassName(false), msw);
DECLARE_THREAD_INFO_NOINIT
MethScopeVariableEnvironment fenv(this);
directBind(env, caller, fenv);
fenv.setCurrentObject(obj);
fenv.setCurrentAlias(alias);
EvalFrameInjection::EvalStaticClassNameHelper helper(obj);
EvalFrameInjection fi(msw->m_className, m_fullName->data(), fenv,
loc()->file, obj.get(), FrameInjection::ObjectMethod);
if (m_ref) {
return strongBind(evalBody(fenv));
}
return evalBody(fenv);
}
示例12: setCurrentObject
void VariableEnvironment::setCurrentObject(CObjRef co) {
ASSERT(!m_currentClass);
m_currentObject = co;
m_currentClass = co->o_getClassName();
getVar(s_this, SgNormal) = co;
}
示例13: f_get_resource_type
String f_get_resource_type(CObjRef handle) {
if (handle.isResource()) {
return handle->o_getClassName();
}
return "";
}
示例14: setCurrentObject
void VariableEnvironment::setCurrentObject(CObjRef co) {
ASSERT(!m_currentClass);
m_currentObject = co;
m_currentClass = co->o_getClassName();
get("this") = co;
}