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


C++ Member::IsStatic方法代码示例

本文整理汇总了C++中Member::IsStatic方法的典型用法代码示例。如果您正苦于以下问题:C++ Member::IsStatic方法的具体用法?C++ Member::IsStatic怎么用?C++ Member::IsStatic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Member的用法示例。


在下文中一共展示了Member::IsStatic方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PrintUnhandledError

void VM::PrintUnhandledError(Thread *const thread)
{
	Value &error = thread->currentError;
	PrintInternal(stderr, L"Unhandled error: %ls: ", error.type->fullName);

	String *message = nullptr;
	// If the member exists and is a readable instance property,
	// we can actually try to invoke the 'message' getter!
	Member *msgMember = error.type->FindMember(strings->members.message, nullptr);
	if (msgMember && !msgMember->IsStatic() && msgMember->IsProperty())
	{
		Property *msgProp = static_cast<Property*>(msgMember);
		if (msgProp->getter != nullptr)
		{
			thread->Push(&error);

			Value result;
			int r = thread->InvokeMethod(msgProp->getter, 0, &result);
			if (r == OVUM_SUCCESS && result.type == types.String)
				message = result.v.string;
		}
	}
	if (message == nullptr)
		message = error.v.error->message;
	if (message != nullptr)
		PrintErrLn(message);

	if (error.v.error->stackTrace)
		PrintErrLn(error.v.error->stackTrace);
}
开发者ID:osprey-lang,项目名称:ovum,代码行数:30,代码来源:vm.cpp

示例2: VirtualMachineException

	Function *VirtualMachine::GetRuntimeFunction(const std::string &name, bool isStatic)
	{
		// Find the module member.
		Member *member = runtimeModule->GetMember(name);
		if(!member || !member->IsFunction() || member->IsStatic() != isStatic)
			throw VirtualMachineException("Using incompatible runtime, cannot find: " + name);
		
		// Cast and declare the function.
		Function *function = static_cast<Function*> (member);
		function->DeclarePass();
		return function;		
	}
开发者ID:ronsaldo,项目名称:chela,代码行数:12,代码来源:VirtualMachine.cpp

示例3: main

int main ( int argc, char *argv[] ) {

	std::cout << "\nReflex C++ Test...\n";
	std::string className("MyClass");

	std::cout << "\nAnalyzing class: " << className;
	std::cout << "\n-----------------";
	Type myType = Type::ByName ( className );

	std::cout << "\nListing out all functions that contain Annotations... " << std::endl;
	int numberOfMembers = myType.FunctionMemberSize ( INHERITEDMEMBERS_NO );

	// FunctionMember_Begin
	for ( int i=0; i < numberOfMembers; i++ ) {
		Member member = myType.FunctionMemberAt ( i, INHERITEDMEMBERS_NO );

		if ( member.IsStatic ( ) == true ) {
			AnnotationList annotationList = member.Annotations();
			if ( annotationList.AnnotationSize() > 0 ) {
				if ( annotationList.HasAnnotation ( typeid(ExcelFunction) ) ) {
					const ExcelFunction* func = annotationList.AnnotationWithType<ExcelFunction> ( );
					std::cout << "\n";
					std::cout << "\nfunc.name: " << func->getName();
					std::cout << "\nfunc.help: " << func->getHelp ();
					std::cout << "\nfunc.category: " << func->getCategory ();
					std::cout << "\nfunc.argHelp: " << func->getArgHelp ();

/*
					int result = 0;
					std::vector<void *> parameters;
					int age_parm = 33;
					float mul_parm = 0.5;
					parameters.push_back ( &age_parm );
					parameters.push_back ( &mul_parm );
					member.Invoke <int &> ( result, parameters );
					std::cout << "\nResult of invoking: " << result;
					std::cout << "\nPlus 7 = " << result + 7;
*/
				}
			}
		}
	}

	return (0);
}
开发者ID:GiannisRambo,项目名称:Reflex,代码行数:45,代码来源:main.cpp


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