本文整理汇总了C++中MethodInfo::isStatic方法的典型用法代码示例。如果您正苦于以下问题:C++ MethodInfo::isStatic方法的具体用法?C++ MethodInfo::isStatic怎么用?C++ MethodInfo::isStatic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MethodInfo
的用法示例。
在下文中一共展示了MethodInfo::isStatic方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
MethodInfo *Assembly::getStaticMethodInfo(const char *name)
{
utArray<Type *> types;
for (UTsize i = 0; i < modules.size(); i++)
{
modules.at(i)->getTypes(types);
for (UTsize j = 0; j < types.size(); j++)
{
Type *type = types.at(j);
MemberTypes types;
types.method = true;
utArray<MemberInfo *> members;
type->findMembers(types, members);
for (UTsize k = 0; k < members.size(); k++)
{
//TODO: this get's the first static main method, at compiler time
// we need to verify only one entry per assembly
MethodInfo *methodInfo = (MethodInfo *)members.at(k);
if (methodInfo->isStatic() && !strcmp(methodInfo->getName(), name))
{
return methodInfo;
}
}
}
types.clear();
}
return NULL;
}
示例2: invokeStaticMethod
void LSLuaState::invokeStaticMethod(const utString& typePath,
const char *methodName, int numParameters)
{
Type *type = getType(typePath.c_str());
lmAssert(type, "LSLuaState::invokeStaticMethod unknown type: %s", typePath.c_str());
MemberInfo *member = type->findMember(methodName);
lmAssert(member, "LSLuaState::invokeStaticMethod unknown member: %s:%s", typePath.c_str(), methodName);
if (!member->isMethod())
{
lmAssert(0, "LSLuaState::invokeStaticMethod member: %s:%s is not a method", typePath.c_str(), methodName);
}
MethodInfo *method = (MethodInfo *)member;
lmAssert(method->isStatic(), "LSLuaState::invokeStaticMethod member: %s:%s is not a static method", typePath.c_str(), methodName);
method->invoke(NULL, numParameters);
}