当前位置: 首页>>代码示例>>C++>>正文


C++ MethodInfo::isStatic方法代码示例

本文整理汇总了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;
}
开发者ID:24BitGames,项目名称:LoomSDK,代码行数:34,代码来源:lsAssembly.cpp

示例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);
}
开发者ID:Bewolf2,项目名称:LoomSDK,代码行数:20,代码来源:lsLuaState.cpp


注:本文中的MethodInfo::isStatic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。