本文整理汇总了C++中ModuleManager类的典型用法代码示例。如果您正苦于以下问题:C++ ModuleManager类的具体用法?C++ ModuleManager怎么用?C++ ModuleManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModuleManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defined
ConnectionManager::ConnectionManager(const int port, const Config &cfg)
{
this->_cfgMgr = cfg;
#if defined(WIN32) || defined(WIN64)
this->cmInitWSA();
#endif
this->cmSetSocket();
this->cmBind(port);
this->_cfgMgr.setPort(Tools::intToString(port));
this->_cfgMgr.setIp(std::string(inet_ntoa(this->_src_inf.sin_addr)));
this->cmListen();
this->_selectTime.tv_sec = 0;
this->_selectTime.tv_usec = 100;
std::cout << "Socket #" << this->_sock << " OK ! Listening on port " << port << "." << std::endl;
this->_cfgMgr.dump();
ModuleManager *mm;
mm = ModuleManager::getInstance();
// mm->LoadModule("mod_bf.dll", this->_cfgMgr);
mm->LoadModule("./zia_ban.dll", this->_cfgMgr);
mm->LoadModule("./zia_html.dll", this->_cfgMgr);
// mm->LoadModule("zia_ban.dll", this->_cfgMgr);
// mm->LoadModule("mod_test1.dll", this->_cfgMgr);
}
示例2: dropMimeData
bool ModuleList::dropMimeData(QTreeWidgetItem *parent, int index,
const QMimeData *data, Qt::DropAction action) {
cout << "DROP! Formats: " << data->formats().join(";").toStdString()
<< endl;
if (!parent) {
return false;
}
MyMimeData *mmd = (MyMimeData*) data;
QTreeWidgetItem * draggedItem = mmd->indexes().first();
QTreeWidgetItem * targetItem = parent;
ModuleManager * mm = MainWindow::getLastInstance()->getModuleManager();
ComparisonDialog dia;
if ((mm->getMatchingModule(draggedItem))->getModuleManager() == mm) {
cout << "Ja! 1" << endl;
}
if ((mm->getMatchingModule(targetItem))->getModuleManager() == mm) {
cout << "Ja! 2" << endl;
}
dia.addWidgets(ModuleManager::cloneModule(
mm->getMatchingModule(draggedItem)), ModuleManager::cloneModule(
mm->getMatchingModule(targetItem)));
dia.setModal(true);
dia.exec();
return true;
}
示例3:
void mod_module_manager_register_module
(
Mod_ModuleManager* manager,
const char* module
)
{
ModuleManager* mngr = (ModuleManager*)manager;
mngr->registerModule( std::string( module ) );
}
示例4: requestML
int ModuleManager::requestML(const char *path,
const char *types,
lo_arg **argv,
int argc,
void *data,
void *user_data)
{
ModuleManager *mm = (ModuleManager *)user_data;
mm->sendModuleList();
return 1;
}
示例5:
AutoCommon::~AutoCommon(void)
{
ModuleManager *pModMng = ModuleManager::instance();
pModMng->UnRegisterModule(this);
#ifdef SDB_COMMON_HAS_TIMER
delete m_pTimerThread;
#endif
#ifdef SDB_COMMON_HAS_EVENT
delete m_pEventThread;
#endif
};
示例6: main
int main()
{
Server *s;
Coordinator *co;
ModuleManager *mm;
XBeeController *xbc;
Serial *se;
MyModule *mym;
int mIndex;
char dn[128];
dn[0] = '/';
printf("Please Enter Your Device Name!\n");
scanf("%s", &dn[1]);
s = new Server();
xbc = new XBeeController(s, "/XBC", "/dev/cu.usbserial-A50178PJ");
mm = new ModuleManager(s, dn);
co = new Coordinator(s, "/Coordinator");
se = new Serial(s, "/Serial", "/dev/cu.usbmodemfd131");
mym = new MyModule(s, "/MM");
mm->sendModuleList();
xbc->co = co;
co->xbc = xbc;
se->connectTo(mym, "/Stream");
while (1) {
printf("Enter Module Index\n");
scanf("%d", &mIndex);
if (!mIndex) break;
if (mIndex == -1) {
co->ml->requestML();
co->ml->displayModules();
}
if (mym->tID)
co->ml->createModule(mym->tID, mIndex);
}
return 0;
}
示例7: loadModules
namespace kurento
{
static ModuleManager moduleManager;
ModuleManager &getModuleManager ()
{
return moduleManager;
}
void loadModules (const std::string &path)
{
moduleManager.loadModulesFromDirectories (path);
}
} /* kurento */
示例8: main
// argument is a configFile
int main(int argc, char** argv){
// Declare a group of options that will be allowed only on command line
po::options_description generic("Generic options");
generic.add_options()
("version,v", "print version string")
("help,h", "produce help message")
;
po::options_description config("Program options");
config.add_options()
("configuration,c", po::value< string >(), "defines the path to an already created and stored chain configuration, written in yaml")
("input,i", po::value< vector<string> >()->composing(), "defines an input, can be used multiple times format: inputName:fileName inputName is optional if there is only one input")
("output,o", po::value< vector<string> >()->composing(), "defines an output, can be used multiple times, format: outputName:fileName. outputName is optional, if there is only one input. Output is optional, if there is only one input and one output, the output filename will be chosen from the input name in this case.")
("param,p", po::value< vector<string> >()->composing(), "defines a parameter, format: name:value")
;
// Hidden options, will be allowed command line, but will not be shown to the user.
po::options_description hidden("Hidden options");
hidden.add_options()
("modulename,m", po::value< string>(), "defines the name of the module")
;
// These two lines say that all positional options should be translated into "-modulename" options.
po::positional_options_description p;
p.add("modulename", -1);
// Declare an options description instance which will include all the options
po::options_description allOptions("Allowed options");
allOptions.add(generic).add(config).add(hidden);
// Declare an options description instance which will be shown to the user
po::options_description visibleOptions("Allowed options");
visibleOptions.add(generic).add(config);
// process input parameters and store the result in vm
po::variables_map vm;
store(po::command_line_parser(argc, argv).options(allOptions).positional(p).run(), vm);
po::notify(vm);
if (argc < 2) {
std::cerr << "Usage Error!\n\n";
cout << "Usage:" << endl;
cout << argv[0] << " -c <path to configuration file> run a processing chain from a config file." << endl;
cout << argv[0] << " <moduleName> -i <input> [-p <params> -o <output>] run a single module." << endl;
cout << "\n";
// show help
cout << visibleOptions;
return 1;
}
// used by the module manager to access Qt components, TODO maybe move to module manager?
QApplication app (argc,argv);
ModuleManager mm;
Configuration conf;
if (vm.count("configuration")){
// run a processing chain from a config file.
// ./uipf -c example.yam
// loads the configFile and create a Configuration
string configFileName = argv[2];
conf.load(configFileName);
} else{
// run a single module.
// ./uipf <moduleName> ...options...
if (vm.count("version")) {
cout << "Version: 1.0" << "\n";
return 0;
}
if (vm.count("help")) {
cout << "Usage:" << endl;
cout << argv[0] << " -c <path to configuration file> run a processing chain from a config file." << endl;
cout << argv[0] << " <moduleName> -i <input> [-p <params> -o <output>] run a single module." << endl;
cout << "\n";
cout << visibleOptions;
return 0;
}
if (!vm.count("modulename") || !vm.count("input")){
std::cerr << "Usage Error!\n\n";
cout << "Usage:" << endl;
cout << argv[0] << " -c <path to configuration file> run a processing chain from a config file." << endl;
cout << argv[0] << " <moduleName> -i <input> [-p <params> -o <output>] run a single module." << endl;
cout << "\n";
// show help
cout << visibleOptions;
return 1;
}
string modName = vm["modulename"].as<string>();
if (!mm.hasModule(modName)) {
//.........这里部分代码省略.........
示例9: nodes_end
static nodes_iterator nodes_end(const ModuleManager &Manager) {
return Manager.end();
}
示例10: nodes_begin
static nodes_iterator nodes_begin(const ModuleManager &Manager) {
return Manager.begin();
}
示例11: ensureModuleLoaded
void ModuleManager::ensureModuleLoaded(const std::string& moduleName)
{
ModulePtr module = g_modules.getModule(moduleName);
if(!module || !module->load())
g_logger.fatal(stdext::format("Unable to load '%s' module", moduleName));
}
示例12: ensureModuleLoaded
void ModuleManager::ensureModuleLoaded(const std::string& moduleName)
{
ModulePtr module = g_modules.getModule(moduleName);
if(!module || !module->load())
logFatal("Unable to load '", moduleName, "' module");
}
示例13: initialize
void ContentManager::initialize(ModuleManager& manager)
{
mModules = manager.filter(ModuleKind::eContentModule);
}
示例14:
GF::GF()
{
boost::property_tree::ptree ac, audioCodecs, vc, videoCodecs;
gst_init (NULL, NULL);
moduleManager.loadModulesFromDirectories ("../../src/server");
mediaPipelineId = moduleManager.getFactory ("MediaPipeline")->createObject (
config, "",
Json::Value() )->getId();
}
示例15:
GF::GF()
{
boost::property_tree::ptree ac, audioCodecs, vc, videoCodecs;
gst_init(nullptr, nullptr);
moduleManager.loadModulesFromDirectories ("../../src/server:../../..");
config.add ("configPath", "../../../tests" );
config.add ("modules.kurento.SdpEndpoint.numAudioMedias", 1);
config.add ("modules.kurento.SdpEndpoint.numVideoMedias", 1);
ac.put ("name", "opus/48000/2");
audioCodecs.push_back (std::make_pair ("", ac) );
config.add_child ("modules.kurento.SdpEndpoint.audioCodecs", audioCodecs);
vc.put ("name", "VP8/90000");
videoCodecs.push_back (std::make_pair ("", vc) );
config.add_child ("modules.kurento.SdpEndpoint.videoCodecs", videoCodecs);
mediaPipelineId = moduleManager.getFactory ("MediaPipeline")->createObject (
config, "",
Json::Value() )->getId();
}