本文整理汇总了C++中PluginManager::load方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginManager::load方法的具体用法?C++ PluginManager::load怎么用?C++ PluginManager::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager::load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setUp
void setUp() {
if (!_initialized) {
_initialized = 1;
_pmgr.load(_plugin);
}
// Storage is tied to the main event loop, which requires quite a bit of setup
ObjectHostID oh_id(1);
_trace = new Trace::Trace("dummy.trace");
_ios = new Network::IOService("StorageTest");
_mainStrand = _ios->createStrand("StorageTest");
_work = new Network::IOWork(*_ios, "StorageTest");
Time start_time = Timer::now(); // Just for stats in ObjectHostContext.
Duration duration = Duration::zero(); // Indicates to run forever.
_sstConnMgr = new ODPSST::ConnectionManager();
_ohSSTConnMgr = new OHDPSST::ConnectionManager();
_ctx = new ObjectHostContext("test", oh_id, _sstConnMgr, _ohSSTConnMgr, _ios, _mainStrand, _trace, start_time, duration);
_storage = OH::StorageFactory::getSingleton().getConstructor(_type)(_ctx, _args);
for(int i = 0; i < 2; i++)
_storage->leaseBucket(_buckets[i]);
_ctx->add(_ctx);
_ctx->add(_storage);
// Run the context, but we need to make sure it only lives in other
// threads, otherwise we'd block up this one. We include 4 threads to
// exercise support for multiple threads.
_ctx->run(4, Context::AllNew);
}
示例2: main
int main(int argc,const char**argv) {
using namespace Sirikata;
OptionSet::getOptions("")->parse(argc,argv);
Network::IOService*io=Network::IOServiceFactory::makeIOService();
//FIXME
//Network::IOServiceFactory::runService(io);
PluginManager plugins;
const char* pluginNames[] = { "mono", NULL};
for(const char** plugin_name = pluginNames; *plugin_name != NULL; plugin_name++)
plugins.load( DynamicLibrary::filename(*plugin_name) );
return 0;
}
示例3: main
int main ( int argc,const char**argv ) {
int myargc = argc+2;
const char **myargv = new const char*[myargc];
memcpy(myargv, argv, argc*sizeof(const char*));
myargv[argc] = "--moduleloglevel";
myargv[argc+1] = "transfer=fatal,ogre=fatal,task=fatal,resource=fatal";
using namespace Sirikata;
PluginManager plugins;
const char* pluginNames[] = { "tcpsst", "monoscript", "sqlite", "ogregraphics", "bulletphysics", "colladamodels", NULL};
for(const char** plugin_name = pluginNames; *plugin_name != NULL; plugin_name++)
plugins.load( DynamicLibrary::filename(*plugin_name) );
OptionSet::getOptions ( "" )->parse ( myargc,myargv );
#ifdef __GNUC__
#ifndef __APPLE__
if (floatExcept->as<bool>()) {
feenableexcept(FE_DIVBYZERO|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
}
#endif
#endif
OptionMapPtr transferOptions (new OptionMap);
{
std::string contents(cdnConfigFile->as<String>());
std::string::size_type pos(0);
parseConfig(contents, transferOptions, transferOptions, pos);
std::cout << *transferOptions;
}
initializeProtocols();
Network::IOService *ioServ = Network::IOServiceFactory::makeIOService();
Task::WorkQueue *workQueue = new Task::LockFreeWorkQueue;
Task::GenEventManager *eventManager = new Task::GenEventManager(workQueue);
SpaceID mainSpace(UUID("12345678-1111-1111-1111-DEFA01759ACE",UUID::HumanReadable()));
SpaceIDMap *spaceMap = new SpaceIDMap;
spaceMap->insert(mainSpace, Network::Address(host->as<String>(),"5943"));
String localDbFile=dbFile->as<String>();
if (localDbFile.length()&&localDbFile[0]!='/'&&localDbFile[0]!='\\') {
FILE * fp=fopen(localDbFile.c_str(),"rb");
for (int i=0;i<4&&fp==NULL;++i) {
localDbFile="../"+localDbFile;
fp=fopen(localDbFile.c_str(),"rb");
}
if (fp) fclose(fp);
else localDbFile=dbFile->as<String>();
}
Persistence::ReadWriteHandler *database=Persistence::ReadWriteHandlerFactory::getSingleton()
.getConstructor("sqlite")(String("--databasefile ")+localDbFile);
ObjectHost *oh = new ObjectHost(spaceMap, workQueue, ioServ);
oh->registerService(Services::PERSISTENCE, database);
{
UUIDLister lister(oh, mainSpace);
lister.goWait(ioServ, workQueue);
}
ProxyManager *provider = oh->getProxyManager(mainSpace);
if (!provider) {
SILOG(cppoh,error,String("Unable to load database in ") + String(dbFile->as<String>()));
std::cout << "Press enter to continue" << std::endl;
std::cerr << "Press enter to continue" << std::endl;
fgetc(stdin);
return 1;
}
TransferManager *tm;
try {
tm = initializeTransferManager((*transferOptions)["cdn"], eventManager);
} catch (OptionDoesNotExist &err) {
SILOG(input,fatal,"Fatal Error: Failed to load CDN config: " << err.what());
std::cout << "Press enter to continue" << std::endl;
std::cerr << "Press enter to continue" << std::endl;
fgetc(stdin);
return 1;
}
OptionSet::getOptions("")->parse(myargc,myargv);
String graphicsCommandArguments;
{
std::ostringstream os;
os << "--transfermanager=" << tm << " ";
os << "--eventmanager=" << eventManager << " ";
os << "--workqueue=" << workQueue << " ";
graphicsCommandArguments = os.str();
}
if (!provider) {
SILOG(cppoh,error,"Failed to get TopLevelSpaceConnection for main space "<<mainSpace);
}
bool continue_simulation = true;
typedef std::vector<TimeSteppedSimulation*> SimList;
SimList sims;
//.........这里部分代码省略.........