本文整理汇总了C++中GetFunction函数的典型用法代码示例。如果您正苦于以下问题:C++ GetFunction函数的具体用法?C++ GetFunction怎么用?C++ GetFunction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetFunction函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: defined
// CONSTRUCTOR
//------------------------------------------------------------------------------
/*explicit*/ CachePlugin::CachePlugin( const AString & dllName ) :
#if defined( __WINDOWS__ )
m_DLL( nullptr ),
#endif
m_InitFunc( nullptr ),
m_ShutdownFunc( nullptr ),
m_PublishFunc( nullptr ),
m_RetrieveFunc( nullptr ),
m_FreeMemoryFunc( nullptr )
{
#if defined( __WINDOWS__ )
m_DLL = ::LoadLibrary( dllName.Get() );
if ( !m_DLL )
{
FLOG_WARN( "Cache plugin '%s' load failed (0x%x).", dllName.Get(), ::GetLastError() );
return;
}
m_InitFunc = (CacheInitFunc) GetFunction( "CacheInit", "[email protected]@[email protected]" );
m_ShutdownFunc = (CacheShutdownFunc) GetFunction( "CacheShutdown", "[email protected]@YAXXZ" );
m_PublishFunc = (CachePublishFunc) GetFunction( "CachePublish", "[email protected]@[email protected]" );
m_RetrieveFunc = (CacheRetrieveFunc) GetFunction( "CacheRetrieve", "[email protected]@[email protected]" );
m_FreeMemoryFunc= (CacheFreeMemoryFunc) GetFunction( "CacheFreeMemory", "[email protected]@[email protected]" );
#elif defined( __APPLE__ )
ASSERT( false ); // TODO:MAC Implement CachePlugin
#elif defined( __LINUX__ )
ASSERT( false ); // TODO:LINUX Implement CachePlugin
#else
#error Unknown platform
#endif
}
开发者ID:grimtraveller,项目名称:fastbuild,代码行数:33,代码来源:CachePlugin.cpp
示例2: GetFunctionNum
void Statement::WriteToFile(FILE* fp, int indent)const
{
#if _DEBUG
int num = GetFunctionNum();
Function* func1 = GetFunction(0);
Function* func2 = GetFunction(1);
if (num == 2 && NULL != func1 && NULL != func2 && func1->GetCall().GetParamClass() == Call::PARAM_CLASS_TERNARY_OPERATOR && func2->GetCall().GetParamClass() == Call::PARAM_CLASS_TERNARY_OPERATOR){
ISyntaxComponent* pcomp0 = func1->GetCall().GetParam(0);
ISyntaxComponent* pcomp1 = func1->GetStatement(0);
ISyntaxComponent* pcomp2 = func2->GetStatement(0);
if (NULL!=pcomp0 && NULL != pcomp1 && NULL != pcomp2){
WriteComponent(fp, *pcomp0, indent);
fwrite(" ? ", 3, 1, fp);
WriteComponent(fp, *pcomp1, 0);
fwrite(" : ", 3, 1, fp);
WriteComponent(fp, *pcomp2, 0);
}
} else {
for (int ix = 0; ix < num; ++ix){
ISyntaxComponent& component = *GetFunction(ix);
WriteComponent(fp, component, indent);
if (ix < num - 1){
fwrite("\n", 1, 1, fp);
}
}
}
#endif
}
开发者ID:CQiao,项目名称:DSL,代码行数:28,代码来源:Dsl.cpp
示例3: LOGERROR
void ScriptFile::AddEventHandler(Object* sender, StringHash eventType, const String& handlerName)
{
if (!compiled_)
return;
if (!sender)
{
LOGERROR("Null event sender for event " + String(eventType) + ", handler " + handlerName);
return;
}
String declaration = "void " + handlerName + "(StringHash, VariantMap&)";
asIScriptFunction* function = GetFunction(declaration);
if (!function)
{
declaration = "void " + handlerName + "()";
function = GetFunction(declaration);
if (!function)
{
LOGERROR("Event handler function " + handlerName + " not found in " + GetName());
return;
}
}
SubscribeToEvent(sender, eventType, HANDLER_USERDATA(ScriptFile, HandleScriptEvent, (void*)function));
}
开发者ID:jjiezheng,项目名称:urho3d,代码行数:26,代码来源:ScriptFile.cpp
示例4: wxLogDebug
wxString wxStringFormatter::DoFunction(wxString func, wxString block)
{
wxLogDebug("DoFunction: " + block);
if(GetFunction(func))
{
return GetFunction(func)->Parse(ReplaceSymbols(block));
}
return func + block;
}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:9,代码来源:stringformatter.cpp
示例5: DiagStackFrame
DiagNativeStackFrame::DiagNativeStackFrame(
ScriptFunction* function,
int byteCodeOffset,
void* stackAddr,
void *codeAddr,
int frameIndex) :
DiagStackFrame(frameIndex),
m_function(function),
m_byteCodeOffset(byteCodeOffset),
m_stackAddr(stackAddr),
m_localVarSlotsOffset(InvalidOffset),
m_localVarChangedOffset(InvalidOffset)
{
Assert(m_stackAddr != NULL);
AssertMsg(m_function && m_function->GetScriptContext() && m_function->GetScriptContext()->IsInDebugMode(),
"This only supports functions in debug mode.");
FunctionEntryPointInfo * entryPointInfo = GetFunction()->GetEntryPointFromNativeAddress((DWORD_PTR)codeAddr);
if (entryPointInfo)
{
m_localVarSlotsOffset = entryPointInfo->localVarSlotsOffset;
m_localVarChangedOffset = entryPointInfo->localVarChangedOffset;
}
else
{
AssertMsg(FALSE, "Failed to get entry point for native address. Most likely the frame is old/gone.");
}
OUTPUT_TRACE(Js::DebuggerPhase, L"DiagNativeStackFrame::DiagNativeStackFrame: e.p(addr %p)=%p varOff=%d changedOff=%d\n", codeAddr, entryPointInfo, m_localVarSlotsOffset, m_localVarChangedOffset);
}
开发者ID:EdwardBetts,项目名称:spidernode,代码行数:29,代码来源:DiagStackFrame.cpp
示例6: CreateTimer
void CreateTimer(ScriptValue &s, ScriptValue *args) {
if (args[1].intVal < 1 || args[1].intVal > (1<<30)) {
return;
}
ObjectValue *obj;
int function = GetFunction(&args[0], &args[3], obj);
if (function < 0) return;
int index = FindTimerSpace();
if (index == -1) {
if (obj) obj->Release();
return;
}
if (!(timers[index].slowTimer = (Timer*) malloc(sizeof(Timer)))) {
if (obj) obj->Release();
timers[index].type = KILLED_TIMER;
return;
}
timers[index].obj = obj;
timers[index].type = SLOW_TIMER;
timers[index].function = function;
timers[index].slowTimer->Init(SlowTimerProc, (void*)(size_t)index, args[1].intVal, RUN_ALWAYS, 0, SAVE_NONE);
if (timers[index].slowTimer->timerMode != RUN_ALWAYS) {
timers[index].Kill();
}
else {
CreateIntValue(s, index+1);
if (args[2].intVal == 0) {
timers[index].slowTimer->lastRun = time64i();
timers[index].slowTimer->ChangeDelay(timers[index].slowTimer->delay);
}
}
}
开发者ID:ZmeyNet,项目名称:lcdmiscellany,代码行数:32,代码来源:ScriptTimer.cpp
示例7: CreateFastTimer
void CreateFastTimer(ScriptValue &s, ScriptValue *args) {
if (args[1].intVal < 10 || args[1].intVal > 3600000) {
return;
}
ObjectValue *obj;
int function = GetFunction(&args[0], &args[3], obj);
if (function < 0) return;
int index = FindTimerSpace();
if (index == -1) {
if (obj) obj->Release();
return;
}
timers[index].type = FAST_TIMER;
timers[index].obj = obj;
timers[index].function = function;
timers[index].fastTimer.active = 0;
timers[index].fastTimer.id = index+10;
timers[index].fastTimer.delay = args[1].i32;
if (!timers[index].Start(1)) {
timers[index].Kill();
}
else {
CreateIntValue(s, index+1);
if (args[2].intVal)
RunTimerFunction(timers[index].function, timers[index].obj, index+1);
}
}
开发者ID:ZmeyNet,项目名称:lcdmiscellany,代码行数:28,代码来源:ScriptTimer.cpp
示例8: NSMain
extern "C" void NSMain(const v8::FunctionCallbackInfo<v8::Value>& args)
{
auto isolate = args.GetIsolate();
auto len = args.Length();
if (len != 5)
{
auto errMsg = v8::String::NewFromUtf8(isolate, "Wrong number of arguments (expected 5)");
auto err = v8::Exception::Error(errMsg);
isolate->ThrowException(err);
return;
}
auto exports = args[1].As<v8::Object>();
auto ft = v8::FunctionTemplate::New(isolate, AddFuncCallback);
auto ctx = isolate->GetCurrentContext();
auto maybeFunc = ft->GetFunction(ctx);
if (maybeFunc.IsEmpty())
{
auto errMsg = v8::String::NewFromUtf8(isolate, "Cannot create 'add' function");
auto err = v8::Exception::Error(errMsg);
isolate->ThrowException(err);
return;
}
auto func = maybeFunc.ToLocalChecked();
auto propName = v8::String::NewFromUtf8(isolate, "add");
auto result = exports->Set(ctx, propName, func);
}
开发者ID:NativeScript,项目名称:sample-native-module,代码行数:32,代码来源:Calc.cpp
示例9: pkcs11_C_GetMechanismList
static VALUE
pkcs11_C_GetMechanismList(VALUE self, VALUE slot_id)
{
CK_RV rv;
CK_C_GetMechanismList func;
CK_MECHANISM_TYPE_PTR types;
CK_ULONG count;
VALUE ary;
CK_ULONG i;
ary = rb_ary_new();
GetFunction(self, C_GetMechanismList, func);
CallFunction(C_GetMechanismList, func, rv, NUM2HANDLE(slot_id), NULL_PTR, &count);
if (rv != CKR_OK) pkcs11_raise(self,rv);
if (count == 0) return ary;
types = (CK_MECHANISM_TYPE_PTR)malloc(sizeof(CK_MECHANISM_TYPE)*count);
if (!types) rb_sys_fail(0);
CallFunction(C_GetMechanismList, func, rv, NUM2HANDLE(slot_id), types, &count);
if (rv != CKR_OK){
free(types);
pkcs11_raise(self,rv);
}
for (i = 0; i < count; i++)
rb_ary_push(ary, HANDLE2NUM(*(types+i)));
free(types);
return ary;
}
开发者ID:cprice404,项目名称:pkcs11,代码行数:29,代码来源:pk11.c
示例10: GetFunction
/*
============
idScriptObject::GetConstructor
============
*/
const function_t *idScriptObject::GetConstructor( void ) const
{
const function_t *func;
func = GetFunction( "init" );
return func;
}
开发者ID:revelator,项目名称:MHDoom,代码行数:12,代码来源:Script_Program.cpp
示例11: CL_Vec2f
void ScrollComponent::OnAdd(Entity *pEnt)
{
EntityComponent::OnAdd(pEnt);
//shared with the rest of the entity
m_vecDisplacement = m_vecChildPos = CL_Vec2f(0,0);
m_pPos2d = &GetParent()->GetVar("pos2d")->GetVector2();
m_pSize2d = &GetParent()->GetVar("size2d")->GetVector2();
//vars in our component namespace
m_pBoundsRect = &GetVarWithDefault("boundsRect", CL_Rectf(0, 0, 0,0))->GetRect();
m_pScrollStyle = &GetVarWithDefault("scrollStyle", uint32(STYLE_MOMENTUM))->GetUINT32();
//only used for "momentum style"
m_pFriction = &GetVarWithDefault("friction", 0.1f)->GetFloat();
m_pMaxScrollSpeed = &GetVarWithDefault("maxScrollSpeed", float(7))->GetFloat();
m_pPowerMod = &GetVarWithDefault("powerMod", float(0.15))->GetFloat();
m_progressVar = GetVar("progress2d");
m_pEnforceFingerTracking = &GetVarWithDefault("fingerTracking", uint32(0))->GetUINT32();
m_pSwipeDetectDistance = &GetVarWithDefault("swipeDetectDistance", 25.0f)->GetFloat();
m_pDontScrollUntilSwipeDetected = &GetVarWithDefault("dontScrollUntilSwipeDetected", uint32(0))->GetUINT32();
m_pEatAllInput = &GetVarWithDefault("eatAllInput", uint32(0))->GetUINT32();
GetParent()->GetFunction("OnOverStart")->sig_function.connect(1, boost::bind(&ScrollComponent::OnOverStart, this, _1));
GetParent()->GetFunction("OnOverEnd")->sig_function.connect(1, boost::bind(&ScrollComponent::OnOverEnd, this, _1));
GetParent()->GetFunction("OnOverMove")->sig_function.connect(1, boost::bind(&ScrollComponent::OnOverMove, this, _1));
GetParent()->GetFunction("OnUpdate")->sig_function.connect(1, boost::bind(&ScrollComponent::OnUpdate, this, _1));
GetFunction("SetProgress")->sig_function.connect(1, boost::bind(&ScrollComponent::SetProgress, this, _1));
}
开发者ID:Zaxuhe,项目名称:Ludum-dare-26,代码行数:28,代码来源:ScrollComponent.cpp
示例12: pkcs11_C_GetSlotList
static VALUE
pkcs11_C_GetSlotList(VALUE self, VALUE presented)
{
CK_ULONG ulSlotCount;
CK_SLOT_ID_PTR pSlotList;
CK_RV rv;
CK_C_GetSlotList func;
CK_ULONG i;
VALUE ary = rb_ary_new();
GetFunction(self, C_GetSlotList, func);
CallFunction(C_GetSlotList, func, rv, CK_FALSE, NULL_PTR, &ulSlotCount);
if (rv != CKR_OK) pkcs11_raise(self,rv);
pSlotList = (CK_SLOT_ID_PTR)malloc(ulSlotCount*sizeof(CK_SLOT_ID));
CallFunction(C_GetSlotList, func, rv, RTEST(presented) ? CK_TRUE : CK_FALSE, pSlotList, &ulSlotCount);
if (rv != CKR_OK) {
free(pSlotList);
pkcs11_raise(self,rv);
}
for (i = 0; i < ulSlotCount; i++)
rb_ary_push(ary, HANDLE2NUM(pSlotList[i]));
free(pSlotList);
return ary;
}
开发者ID:cprice404,项目名称:pkcs11,代码行数:25,代码来源:pk11.c
示例13: input
void
TestFunctionEquality
(
const JCharacter* fileName
)
{
std::ifstream input(fileName);
TestVarList theVarList(input);
JFunction* f1 = NULL;
JFunction* f2 = NULL;
while (1)
{
if (!GetFunction(input, &theVarList, &f1))
{
break;
}
else if (f1 == NULL)
{
continue;
}
if (!GetFunction(input, &theVarList, &f2))
{
jdelete f1;
break;
}
else if (f2 == NULL)
{
jdelete f1;
continue;
}
if (*f1 == *f2)
{
(JGetUserNotification())->DisplayMessage("These functions are the same");
}
else
{
(JGetUserNotification())->DisplayMessage("These functions are not the same");
}
jdelete f1;
jdelete f2;
}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:47,代码来源:test.expr.fns.cpp
示例14: LoadSharedLibrary
Module * ModuleFactory::createModule(const char * path) const {
Info << "Loading " << path;
void *hDLL;
//do not add extension. It is handled by LoadSharedLibrary.
hDLL = LoadSharedLibrary(path);
if (hDLL == 0)
return NULL;
Instance instanciate = (Instance)GetFunction(hDLL, "create");
Destroy destroy = (Destroy)GetFunction(hDLL, "destroy");
if (instanciate == 0 || destroy == 0)
return NULL;
Module * module = instanciate();
module->setCleanLibraryCallback(new CleanLibraryCallBack(hDLL, destroy));
return module;
}
开发者ID:kelibiano,项目名称:KSteganifyer,代码行数:17,代码来源:ModuleFactory.cpp
示例15: InitInstance
void Dollar::InitInstance(Isolate* iso, v8::Handle<v8::Object> & target)
{
auto tmpl = Local<FunctionTemplate>::New(iso, _Template);
// create an instance of dollar object and make a property
auto dollar = tmpl->GetFunction()->NewInstance();
// target->SetAccessor(String::NewFromUtf8(iso, "$"), jsGetter, 0, dollar);
target->Set(String::NewFromUtf8(iso, "$"), dollar);
}
开发者ID:alexezh,项目名称:trv,代码行数:8,代码来源:dollar.cpp
示例16: ir_find_variable
//////////////////////////////////////////////////////////////////////
//
// ClParser::internVarCell
//
// o Returns %rd of VARDEF instruction.
// o Returns %rd of UPVAR instruction in pFun for pVar->
//
Register*
ClParser::internVarCell(Variable* pVar)
{
Register* pCell = ir_find_variable(GetFunction(), pVar);
if (NULL == pCell)
{
pCell = new Register();
Function* pUser = GetFunction();
ir_insert_insn(
new UpVarDefInsn(pCell, pVar),
pUser->GetEntryInsn()->GetNext() );
} // if
return pCell;
} // ClParser::internVarCell
开发者ID:eval1749,项目名称:evita-common-lisp,代码行数:24,代码来源:cl_fns.cpp
示例17: Assert
Var * DiagNativeStackFrame::GetSlotOffsetLocation(RegSlot slotId, bool allowTemp)
{
Assert(GetFunction() != NULL);
int32 slotOffset;
if (GetFunction()->GetSlotOffset(slotId, &slotOffset, allowTemp))
{
Assert(m_localVarSlotsOffset != InvalidOffset);
slotOffset = m_localVarSlotsOffset + slotOffset;
// We will have the var offset only (which is always the Var size. With TypeSpecialization, below will change to accommodate double offset.
return (Js::Var *)(((char *)m_stackAddr) + slotOffset);
}
Assert(false);
return NULL;
}
开发者ID:EdwardBetts,项目名称:spidernode,代码行数:17,代码来源:DiagStackFrame.cpp
示例18: body
static void body (LexState *ls, expdesc *e, int needself, int line) {
/* body -> `(' parlist `)' chunk END */
#ifdef LUA_UTILITIES_NET
char szFuncName1[256];
char szFuncName2[256];
#endif
FuncState new_fs;
open_func(ls, &new_fs);
new_fs.f->linedefined = line;
#ifdef LUA_UTILITIES_NET
szFuncName1[0] = 0;
szFuncName2[0] = 0;
TryGetFunctionName(ls->t.seminfo.ts, szFuncName1, 256);
#endif
checknext(ls, '(');
if (needself) {
new_localvarliteral(ls, "self", 0);
adjustlocalvars(ls, 1);
}
parlist(ls);
checknext(ls, ')');
chunk(ls);
#ifdef LUA_UTILITIES_NET
if (szFuncName1[0] == 0)
TryGetFunctionName(ls->t.seminfo.ts, szFuncName2, 256);
#endif
new_fs.f->lastlinedefined = ls->linenumber;
check_match(ls, TK_END, TK_FUNCTION, line);
close_func(ls);
#ifdef LUA_UTILITIES_NET
// Use the correct function name based on values obtained
if (szFuncName1[0] == 0)
GetFunction(szFuncName2, ls, new_fs.f);
else
GetFunction(szFuncName1, ls, new_fs.f);
#endif
pushclosure(ls, &new_fs, e);
}
开发者ID:arsaccol,项目名称:SLED,代码行数:46,代码来源:lparser.c
示例19: n32016_build_matrix
void n32016_build_matrix()
{
uint32_t Index;
for (Index = 0; Index < 256; Index++)
{
FunctionLookup[Index] = GetFunction(Index);
}
}
开发者ID:hoglet67,项目名称:PiTubeDirect,代码行数:9,代码来源:Decode.c
示例20: GM_MOBJECT
gmThread::State gmThread::Sys_PopStackFrame(const gmuint8 * &a_ip, const gmuint8 * &a_cp)
{
if(m_frame == NULL)
{
m_machine->GetLog().LogEntry("stack underflow");
return SYS_EXCEPTION;
}
// Write barrier old local objects
{
gmGarbageCollector* gc = m_machine->GetGC();
if( !gc->IsOff() )
{
for(int index = m_base-2; index < m_top; ++index)
{
if(m_stack[index].IsReference())
{
gmObject * object = GM_MOBJECT(m_machine, m_stack[index].m_value.m_ref);
gc->WriteBarrier(object);
}
}
}
}
gmStackFrame * frame = m_frame->m_prev;
if( frame == NULL ) // Final frame, we will exit now
{
return KILLED; // Don't clean up stack, let the machine reset it as state changes to killed (so Exit callback can examine valid thread contents)
}
a_ip = m_frame->m_returnAddress;
// Copy old tos to new tos
m_stack[m_base - 2] = m_stack[m_top - 1];
m_top = m_base - 1;
m_base = m_frame->m_returnBase;
m_machine->Sys_FreeStackFrame(m_frame);
m_frame = frame;
// Update instruction and code pointers
GM_ASSERT(GetFunction()->m_type == GM_FUNCTION);
gmFunctionObject * fn = (gmFunctionObject *) GM_MOBJECT(m_machine, GetFunction()->m_value.m_ref);
a_cp = (const gmuint8 *) fn->GetByteCode();
return RUNNING;
}
开发者ID:cgbystrom,项目名称:scriptorium,代码行数:44,代码来源:gmThread.cpp
注:本文中的GetFunction函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论