本文整理汇总了C++中ExecBlock::addFunctions方法的典型用法代码示例。如果您正苦于以下问题:C++ ExecBlock::addFunctions方法的具体用法?C++ ExecBlock::addFunctions怎么用?C++ ExecBlock::addFunctions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExecBlock
的用法示例。
在下文中一共展示了ExecBlock::addFunctions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
Error initialize()
{
boost::shared_ptr<SEXP> pErrorHandler =
boost::make_shared<SEXP>(R_NilValue);
boost::shared_ptr<bool> pHandleUserErrorsOnly =
boost::make_shared<bool>(true);
using boost::bind;
using namespace module_context;
// Check to see whether the error handler has changed immediately after init
// (to find changes from e.g. .Rprofile) and after every console prompt.
events().onConsolePrompt.connect(bind(detectHandlerChange,
pErrorHandler, false));
events().onDeferredInit.connect(bind(detectHandlerChange,
pErrorHandler, true));
userSettings().onChanged.connect(bind(onUserSettingsChanged,
pErrorHandler,
pHandleUserErrorsOnly));
json::JsonRpcFunction setErrMgmt =
bind(setErrHandlerType, pErrorHandler, _1, _2);
ExecBlock initBlock;
initBlock.addFunctions()
(bind(registerRpcMethod, "set_error_management_type", setErrMgmt))
(bind(sourceModuleRFile, "SessionErrors.R"))
(bind(initializeErrManagement, pErrorHandler, pHandleUserErrorsOnly));
return initBlock.execute();
}
示例2: completeEmbeddedRInitialization
Error completeEmbeddedRInitialization(bool useInternet2)
{
// set memory limit
setMemoryLimit();
// use IE proxy settings if requested
boost::format fmt("suppressWarnings(utils::setInternet2(%1%))");
Error error = r::exec::executeString(boost::str(fmt % useInternet2));
if (error)
LOG_ERROR(error);
using boost::bind;
using namespace r::function_hook ;
ExecBlock block ;
block.addFunctions()
(bind(registerUnsupported, "loadhistory", "utils"))
(bind(registerUnsupported, "savehistory", "utils"))
(bind(registerUnsupported, "history", "utils"))
(bind(registerUnsupported, "timestamp", "utils"))
(bind(registerUnsupported, "winMenuAdd", "utils"))
(bind(registerUnsupported, "winMenuAddItem", "utils"))
(bind(registerUnsupported, "winMenuDel", "utils"))
(bind(registerUnsupported, "winMenuDelItem", "utils"))
(bind(registerUnsupported, "winMenuNames", "utils"))
(bind(registerUnsupported, "winMenuItems", "utils"));
return block.execute();
}
示例3: completeEmbeddedRInitialization
Error completeEmbeddedRInitialization(bool useInternet2)
{
// set memory limit
setMemoryLimit();
// use IE proxy settings if requested
if (!r::session::utils::isR3_3())
{
boost::format fmt("suppressWarnings(utils::setInternet2(%1%))");
Error error = r::exec::executeString(boost::str(fmt % useInternet2));
if (error)
LOG_ERROR(error);
}
// register history functions
Error error = r::exec::RFunction(".rs.registerHistoryFunctions").call();
if (error)
LOG_ERROR(error);
using boost::bind;
using namespace r::function_hook ;
ExecBlock block ;
block.addFunctions()
(bind(registerUnsupported, "bringToTop", "grDevices"))
(bind(registerUnsupported, "winMenuAdd", "utils"))
(bind(registerUnsupported, "winMenuAddItem", "utils"))
(bind(registerUnsupported, "winMenuDel", "utils"))
(bind(registerUnsupported, "winMenuDelItem", "utils"))
(bind(registerUnsupported, "winMenuNames", "utils"))
(bind(registerUnsupported, "winMenuItems", "utils"));
return block.execute();
}
示例4: initialize
Error initialize()
{
R_CallMethodDef methodDef;
methodDef.name = "rs_checkSpelling" ;
methodDef.fun = (DL_FUNC) rs_checkSpelling ;
methodDef.numArgs = 1;
r::routines::addCallMethod(methodDef);
// initialize spelling engine
using namespace rstudio::core::spelling;
HunspellSpellingEngine* pHunspell = new HunspellSpellingEngine(
userSettings().spellingLanguage(),
hunspellDictionaryManager(),
&r::util::iconvstr);
s_pSpellingEngine.reset(pHunspell);
// connect to user settings changed
userSettings().onChanged.connect(onUserSettingsChanged);
// register rpc methods
using boost::bind;
using namespace module_context;
ExecBlock initBlock ;
initBlock.addFunctions()
(bind(registerRpcMethod, "check_spelling", checkSpelling))
(bind(registerRpcMethod, "suggestion_list", suggestionList))
(bind(registerRpcMethod, "get_word_chars", getWordChars))
(bind(registerRpcMethod, "add_custom_dictionary", addCustomDictionary))
(bind(registerRpcMethod, "remove_custom_dictionary", removeCustomDictionary))
(bind(registerRpcMethod, "install_all_dictionaries", installAllDictionaries))
(bind(sourceModuleRFile, "SessionSpelling.R"));
return initBlock.execute();
}
示例5: initialize
Error initialize()
{
// register postback handler for sumatra pdf
#ifdef _WIN32
std::string ignoredCommand; // assumes bash script invocation, we
// don't/can't use that for rsinverse
Error error = module_context::registerPostbackHandler("rsinverse",
rsinversePostback,
&ignoredCommand);
if (error)
return error ;
#endif
// install rpc methods
using boost::bind;
using namespace module_context;
ExecBlock initBlock ;
initBlock.addFunctions()
(bind(registerRpcMethod, "apply_forward_concordance", rpcApplyForwardConcordance))
(bind(registerRpcMethod, "apply_inverse_concordance", rpcApplyInverseConcordance))
(bind(registerRpcMethod, "synctex_forward_search", synctexForwardSearch))
(bind(registerRpcMethod, "synctex_inverse_search", synctexInverseSearch))
;
return initBlock.execute();
}
示例6: initialize
Error initialize()
{
if (!session::options().verifyInstallation())
{
// capture standard streams
Error error = initializeOutputCapture();
if (error)
return error;
}
// subscribe to events
using boost::bind;
using namespace module_context;
events().onClientInit.connect(bind(onClientInit));
events().onDetectChanges.connect(bind(onDetectChanges, _1));
// more initialization
using boost::bind;
ExecBlock initBlock ;
initBlock.addFunctions()
(bind(sourceModuleRFile, "SessionConsole.R"))
(bind(registerRpcMethod, "reset_console_actions", resetConsoleActions));
return initBlock.execute();
}
示例7: initialize
Error initialize()
{
using boost::bind;
using namespace module_context;
ExecBlock initBlock;
initBlock.addFunctions()
(bind(sourceModuleRFile, "SessionRHooks.R"));
return initBlock.execute();
}
示例8: initialize
Error initialize()
{
using boost::bind;
using namespace session::module_context;
ExecBlock initBlock ;
initBlock.addFunctions()
(bind(registerUriHandler, "/content", handleContentRequest))
(bind(registerRpcMethod, "remove_content_url", removeContentUrl));
return initBlock.execute();
}
示例9: initHtmlWidgets
core::Error initHtmlWidgets()
{
RS_REGISTER_CALL_METHOD(rs_recordHtmlWidget, 3);
ExecBlock initBlock;
initBlock.addFunctions()
(boost::bind(module_context::sourceModuleRFile, "NotebookHtmlWidgets.R"));
return initBlock.execute();
}
示例10: initialize
Error initialize()
{
// install rpc methods
using boost::bind;
using namespace module_context;
ExecBlock initBlock ;
initBlock.addFunctions()
(bind(registerRpcMethod, "get_public_key", getPublicKey));
return initBlock.execute();
}
示例11: ignoreTerminalSignals
Error ignoreTerminalSignals()
{
ExecBlock ignoreBlock ;
ignoreBlock.addFunctions()
(boost::bind(ignoreSig, SIGHUP))
(boost::bind(ignoreSig, SIGTSTP))
(boost::bind(ignoreSig, SIGTTOU))
(boost::bind(ignoreSig, SIGTTIN));
return ignoreBlock.execute();
}
示例12: initData
core::Error initData()
{
RS_REGISTER_CALL_METHOD(rs_recordData, 2);
ExecBlock initBlock;
initBlock.addFunctions()
(boost::bind(module_context::sourceModuleRFile, "NotebookData.R"))
(boost::bind(module_context::registerUriHandler, kNotebookDataResourceLocation, handleNotebookDataResReq));
return initBlock.execute();
}
示例13: initialize
Error initialize()
{
using boost::bind;
using namespace module_context;
ExecBlock initBlock;
initBlock.addFunctions()
(bind(registerAsyncRpcMethod, "check_for_updates", checkForUpdates))
;
return initBlock.execute();
}
示例14: initialize
Error initialize()
{
// install rpc methods
using boost::bind;
using namespace module_context;
ExecBlock initBlock ;
initBlock.addFunctions()
(bind(registerUriHandler, "/view_pdf", handleViewPdf))
(bind(registerUriHandler, kPdfJsPath, handlePdfJs))
;
return initBlock.execute();
}
示例15: initialize
Error initialize()
{
using boost::bind;
using namespace session::module_context;
ExecBlock initBlock ;
initBlock.addFunctions()
(data::viewer::initialize)
(bind(sourceModuleRFile, "SessionDataImport.R"))
(bind(sourceModuleRFile, "SessionDataImportV2.R"));
return initBlock.execute();
}