本文整理汇总了C++中callFunction函数的典型用法代码示例。如果您正苦于以下问题:C++ callFunction函数的具体用法?C++ callFunction怎么用?C++ callFunction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了callFunction函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pokeEvent
void PokeModel::addPoke(int bank, int address, int value)
{
if (bank < 0 || bank > 64) {
// Pentagon 1024 has 65 memory pages
g_fuseEmulator->showMessage(tr("Invalid bank: use an integer from 0 to 64"), FuseEmulator::Error);
return;
}
if (address < 0 || address > 0xffff) {
emit g_fuseEmulator->showMessage(tr("Invalid address: use an integer from 0 to 65535"), FuseEmulator::Error);
return;
}
if (bank == 8 && address < 0x4000) {
g_fuseEmulator->showMessage(tr("Invalid address: use an integer from 16384 to 65535"), FuseEmulator::Error);
return;
}
pokeEvent([this, bank, address, value]{
auto trainer = pokemem_trainer_list_add(bank, address, value);
if (!trainer->disabled)
pokemem_trainer_activate(trainer);
callFunction([this] {
beginResetModel();
endResetModel();
});
});
}
开发者ID:bog-dan-ro,项目名称:spectacol,代码行数:28,代码来源:pokemodel.cpp
示例2: CToJavaCallHandler_Sub
void __cdecl CToJavaCallHandler_Sub(CallTempStruct* call, NativeToJavaCallbackCallInfo* info, DCArgs* args, DCValue* result)
{
dcMode(call->vm, JNI_CALL_MODE);
//dcReset(call->vm);
if (!info->fCallbackInstance)
{
throwException(call->env, "Trying to call a null callback instance !");
return;
}
dcArgPointer(call->vm, (DCpointer)call->env);
dcArgPointer(call->vm, info->fCallbackInstance);
dcArgPointer(call->vm, info->fInfo.fMethodID);
if (info->fIsObjCBlock)
dcbArgPointer(args); // consume the pointer to the block instance ; TODO use it to reuse native callbacks !!!
if (info->fIsGenericCallback) {
callGenericFunction(call, &info->fInfo, args, result, (void*)(*call->env)->CallObjectMethod);
} else {
callFunction(call, &info->fInfo, args, result, info->fJNICallFunction, CALLING_JAVA | IS_VAR_ARGS);
}
}
开发者ID:Jeyatharsini,项目名称:BridJ,代码行数:25,代码来源:CallbackHandler.c
示例3: callFunction
void PokeModel::update()
{
callFunction([this]{
beginResetModel();
endResetModel();
});
}
开发者ID:bog-dan-ro,项目名称:spectacol,代码行数:7,代码来源:pokemodel.cpp
示例4: RK_TRACE
bool PHPBackend::initialize (const QString &filename, RKComponentPropertyCode *code_property, bool add_headings) {
RK_TRACE (PHP);
if (php_process && php_process->isRunning ()) {
RK_DO (qDebug ("another template is already openend in this backend"), PHP, DL_ERROR);
return false;
}
php_process = new KProcess ();
*php_process << RKSettingsModulePHP::phpBin();
// *php_process << "-a"; // run interactively. Does this have an effect?
*php_process << (RKSettingsModulePHP::filesPath() + "/common.php");
// we have to be connect at all times! Otherwise the connection will be gone for good.
//connect (php_process, SIGNAL (receivedStderr (KProcess *, char*, int)), this, SLOT (gotError (KProcess *, char*, int)));
connect (php_process, SIGNAL (wroteStdin (KProcess *)), this, SLOT (doneWriting (KProcess* )));
connect (php_process, SIGNAL (receivedStdout (KProcess *, char*, int)), this, SLOT (gotOutput (KProcess *, char*, int)));
if (!php_process->start (KProcess::NotifyOnExit, KProcess::All)) {
KMessageBox::error (0, i18n ("The PHP backend could not be started. Check whether you have correctly configured the location of the PHP-binary (Settings->Configure Settings->PHP backend)"), i18n ("PHP-Error"));
emit (haveError ());
return false;
}
busy_writing = doing_command = startup_done = false;
busy = true;
// start the real template
callFunction ("include (\"" + filename + "\");", 0, Ignore);
PHPBackend::code_property = code_property;
PHPBackend::add_headings = add_headings;
return true;
}
开发者ID:svn2github,项目名称:rkward-svn-mirror,代码行数:34,代码来源:phpbackend.cpp
示例5: s
void JSFiber::js_callback()
{
scope s(this);
v8::Local<v8::Value> retVal;
callFunction(retVal);
Unref();
}
开发者ID:Mirwangsir,项目名称:fibjs,代码行数:7,代码来源:Fiber.cpp
示例6: triggerEventAttacked
//__ \subsection{eventAttacked(victim, attacker)}
//__ An event that is run when an object belonging to the script's controlling player is
//__ attacked. The attacker parameter may be either a structure or a droid.
bool triggerEventAttacked(BASE_OBJECT *psVictim, BASE_OBJECT *psAttacker, int lastHit)
{
if (!psAttacker)
{
// do not fire off this event if there is no attacker -- nothing do respond to
// (FIXME -- consider this carefully)
return false;
}
// throttle the event for performance
if (gameTime - lastHit < ATTACK_THROTTLE)
{
return false;
}
for (int i = 0; i < scripts.size(); ++i)
{
QScriptEngine *engine = scripts.at(i);
int player = engine->globalObject().property("me").toInt32();
if (player == psVictim->player)
{
QScriptValueList args;
args += convMax(psVictim, engine);
args += convMax(psAttacker, engine);
callFunction(engine, "eventAttacked", args);
}
}
return true;
}
开发者ID:argit,项目名称:warzone2100,代码行数:30,代码来源:qtscript.cpp
示例7: main
int main(int argc, char** argv)
{
auto py = new Interpret::PythonInterpreter();
//import spam
auto res = py->loadModule("spam");
assert (res == 0 );
//spa.foo2(1,3)
res = py->callFunction("foo2", {"1","3"});
assert (res == 0);
//spa.foo()
res = py->callFunction("foo", {});
assert (res == 0);
return 1;
}
开发者ID:gclkaze,项目名称:PythonInterpreter,代码行数:17,代码来源:demoMain.cpp
示例8: KviKvsVariant
void KvsObject_xmlReader::fatalError(const QString & szError)
{
m_szLastError = szError;
KviKvsVariantList vArgs;
vArgs.append(new KviKvsVariant(m_szLastError));
callFunction(this, "onError", &vArgs);
}
开发者ID:CardinalSins,项目名称:KVIrc,代码行数:8,代码来源:KvsObject_xmlreader.cpp
示例9: callFunction
/**
\return A boolean value indicating whether to restart the timer again.
\sa timerCallBack_t
*/
bool timeElement::clockAlarm ()
{
callFunction ();
if (0 != _repeats) // _repeats == 0 means ad infinitum so don't change.
if (0 == --_repeats)
return false; // timer expired for the last time.
return true;
}
开发者ID:Byron-Watkins,项目名称:Arduino-Timer,代码行数:12,代码来源:Timer.cpp
示例10: main
int main() {
int i;
int sum = 0;
for (i = 0; i < 1000; i++) {
sum += callFunction();
}
return sum == 0;
}
开发者ID:jakre,项目名称:sulong,代码行数:8,代码来源:polymorphic-native-function-pointers1.c
示例11: triggerEvent
/// For generic, parameter-less triggers
bool triggerEvent(SCRIPT_TRIGGER_TYPE trigger)
{
for (int i = 0; i < scripts.size(); ++i)
{
QScriptEngine *engine = scripts.at(i);
switch (trigger)
{
case TRIGGER_GAME_INIT:
callFunction(engine, "eventGameInit", QScriptValueList());
break;
case TRIGGER_START_LEVEL:
callFunction(engine, "eventStartLevel", QScriptValueList());
break;
}
}
return true;
}
开发者ID:JCDG,项目名称:warzone2100,代码行数:19,代码来源:qtscript.cpp
示例12: mexFunction
void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[]) {
if (nrhs != 1)
mexErrMsgTxt("Bad number of input arguments");
if (nlhs != 3)
mexErrMsgTxt("Bad number of output arguments");
callFunction(plhs,prhs,nlhs);
}
开发者ID:Barbakas,项目名称:VOTR,代码行数:9,代码来源:mexTreeOfGroupStruct.cpp
示例13: triggerEventGroupLoss
//__ \subsection{eventGroupLoss(object, group id, new size)}
//__ An event that is run whenever a group becomes empty. Input parameter
//__ is the about to be killed object, the group's id, and the new group size.
// Since groups are entities local to one context, we do not iterate over them here.
bool triggerEventGroupLoss(BASE_OBJECT *psObj, int group, int size, QScriptEngine *engine)
{
QScriptValueList args;
args += convMax(psObj, engine);
args += QScriptValue(group);
args += QScriptValue(size);
callFunction(engine, "eventGroupLoss", args);
return true;
}
开发者ID:argit,项目名称:warzone2100,代码行数:13,代码来源:qtscript.cpp
示例14: setupVaradicArguments
void VM::functionHandler(State *state, Object *self, Object *function, Object **arguments, size_t count) {
(void)self;
ClosureObject *functionObject = (ClosureObject *)function;
Object *context = functionObject->m_context;
GC::disable(state);
context = setupVaradicArguments(state, context, &functionObject->m_closure, arguments, count);
callFunction(state, context, &functionObject->m_closure, arguments, count);
GC::enable(state);
}
开发者ID:dreamsxin,项目名称:neothyne,代码行数:9,代码来源:s_vm.cpp
示例15:
/**
* ---o
* [1,2,3].reduce(fn(sum,key,value){return sum+value;},0) => 6
*/
Object * Collection::rt_reduce(Runtime & runtime,ObjPtr function,ObjPtr initialValue){
ObjRef runningVar= initialValue.isNull() ? Void::get() : initialValue;
for(ERef<Iterator> it=getIterator(); !it->end() ; it->next()){
ObjRef key=it->key();
ObjRef value=it->value();
runningVar=callFunction(runtime,function.get(),ParameterValues(runningVar,key,value));
}
return runningVar.detachAndDecrease();
}
开发者ID:BackupTheBerlios,项目名称:escript-svn,代码行数:14,代码来源:Collection.cpp
示例16: triggerEventCheatMode
//__ \subsection{eventCheatMode(entered)} Game entered or left cheat/debug mode.
//__ The entered parameter is true if cheat mode entered, false otherwise.
bool triggerEventCheatMode(bool entered)
{
for (int i = 0; i < scripts.size(); ++i)
{
QScriptEngine *engine = scripts.at(i);
QScriptValueList args;
args += entered;
callFunction(engine, "eventCheatMode", args);
}
return true;
}
开发者ID:ceridian,项目名称:warzone2100,代码行数:13,代码来源:qtscript.cpp
示例17: callFunction
void DOMTransaction::reapply()
{
if (!m_isAutomatic)
callFunction("redo");
else {
for (size_t i = 0; i < m_transactionSteps.size(); ++i)
m_transactionSteps[i]->reapply();
}
if (m_undoManager)
m_undoManager->registerUndoStep(this);
}
开发者ID:littledj007,项目名称:RespImg-WebCore,代码行数:12,代码来源:DOMTransaction.cpp
示例18: thenPromise
static void thenPromise(ExecState& state, JSPromise* deferredPromise, JSValue fullfilFunction, JSValue rejectFunction)
{
JSValue thenValue = deferredPromise->get(&state, state.vm().propertyNames->then);
if (state.hadException())
return;
MarkedArgumentBuffer arguments;
arguments.append(fullfilFunction);
arguments.append(rejectFunction);
callFunction(state, thenValue, deferredPromise, arguments);
}
开发者ID:GuoCheng111,项目名称:webkit,代码行数:12,代码来源:ReadableJSStream.cpp
示例19: Q_ASSERT
QString ScriptHandler::customToString(const DataInformation* data, const QScriptValue& func)
{
Q_ASSERT(func.isValid());
Q_ASSERT(func.isFunction());
Q_ASSERT(data->wasAbleToRead()); //this should never be called if EOF was reached
//it is effectively const, since nothing may be modified while mode is CustomToString
//const_cast is okay in this case
QScriptValue result = callFunction(func, const_cast<DataInformation*>(data), ScriptHandlerInfo::CustomToString);
if (result.isError())
data->logError() << "toStringFunc caused an error:" << result.toString();
return result.toString();
}
开发者ID:KDE,项目名称:okteta,代码行数:12,代码来源:scripthandler.cpp
示例20: triggerEventPickup
//__ \subsection{eventPickup(feature, droid)}
//__ An event that is run whenever a feature is picked up. It is called for
//__ all players / scripts.
//__ Careful passing the parameter object around, since it is about to vanish! (3.2+ only)
bool triggerEventPickup(FEATURE *psFeat, DROID *psDroid)
{
for (int i = 0; i < scripts.size(); ++i)
{
QScriptEngine *engine = scripts.at(i);
QScriptValueList args;
args += convFeature(psFeat, engine);
args += convDroid(psDroid, engine);
callFunction(engine, "eventPickup", args);
}
return true;
}
开发者ID:ceridian,项目名称:warzone2100,代码行数:16,代码来源:qtscript.cpp
注:本文中的callFunction函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论