本文整理汇总了C++中ModuleMap::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ModuleMap::end方法的具体用法?C++ ModuleMap::end怎么用?C++ ModuleMap::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleMap
的用法示例。
在下文中一共展示了ModuleMap::end方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillModules
void MainMenuWindow::fillModules()
{
MenuBase* modulesMenu = getMenu("MainMenu/Modules/Menu");
ModuleMap modules = CoreSubsystem::getSingleton().getAllModules();
mActiveModule = CoreSubsystem::getSingleton().getActiveAdventureModule();
for(ModuleMap::iterator modIt = modules.begin();
modIt != modules.end(); modIt++)
{
ContentModule* mod = (*modIt).second;
if (!mod->isCommon())
{
if (mActiveModule == NULL)
mActiveModule = mod;
MenuItem* it = static_cast<MenuItem*>(
CEGUI::WindowManager::getSingleton().createWindow("RastullahLook/MenuItem",
getNamePrefix()+"MainMenu/Modules/" + mod->getId()));
if (mod == mActiveModule)
it->setText(mod->getName() + " *");
else
it->setText(mod->getName());
modulesMenu->addItem(it);
it->subscribeEvent(
MenuItem::EventClicked,
boost::bind(&MainMenuWindow::handleChooseModule, this, it, mod));
}
}
}
示例2: operator
void operator()(GlobalStatic<T>& globalStatic) const
{
ModuleMap* moduleMap = globalStatic.pointer;
for (ModuleMap::const_iterator i = moduleMap->begin();
i != moduleMap->end(); ++i)
{
delete i->second;
}
DefaultGlobalStaticDeleter<T> defaultDeleter;
defaultDeleter(globalStatic);
}
示例3: Register
void ModuleRegistry::Register(ModuleInfo* info)
{
static long regCount = 0;
if (info->id > 0)
{
// The module was already registered
Module* module = 0;
{
MutexLocker lock(*modulesLock());
module = modules()->operator[](info->id);
assert(module != 0);
}
module->Start();
}
else
{
Module* module = 0;
// check if the module is reloaded
{
MutexLocker lock(*modulesLock());
ModuleMap* map = modules();
for (ModuleMap::const_iterator i = map->begin();
i != map->end(); ++i)
{
if (i->second->GetLocation() == info->location)
{
module = i->second;
info->id = module->GetModuleId();
}
}
}
if (!module)
{
module = new Module();
countLock()->Lock();
info->id = ++regCount;
countLock()->Unlock();
module->Init(coreModuleContext(), info);
MutexLocker lock(*modulesLock());
ModuleMap* map = modules();
map->insert(std::make_pair(info->id, module));
}
else
{
module->Init(coreModuleContext(), info);
}
module->Start();
}
}
示例4: GetModules
void ModuleRegistry::GetModules(std::vector<Module*>& m)
{
MutexLocker lock(*modulesLock());
ModuleMap* map = modules();
ModuleMap::const_iterator iter = map->begin();
ModuleMap::const_iterator iterEnd = map->end();
for (; iter != iterEnd; ++iter)
{
m.push_back(iter->second);
}
}
示例5: lock
std::vector<Module*> ModuleRegistry::GetModules()
{
MutexLock lock(*modulesLock());
std::vector<Module*> result;
ModuleMap* map = modules();
ModuleMap::const_iterator iter = map->begin();
ModuleMap::const_iterator iterEnd = map->end();
for (; iter != iterEnd; ++iter)
{
result.push_back(iter->second);
}
return result;
}
示例6: load_imported_modules
void load_imported_modules(ModuleMap &modmap, const set< string > &modnames)
{
set< string >::const_iterator it(modnames.begin());
map< string, Module * > modules;
for (; it!=modnames.end(); ++it) {
if (modmap.find(*it) != modmap.end()) {
continue;
}
Module *mod = read_module(*it);
if (!mod) {
compile_module(modmap, *it);
mod = read_module(*it);
if (!mod) {
cerr << "could not load module: "<< (*it) & DIE;
}
modmap[*it] = mod;
}
}
}
示例7: moduleReportList
int moduleReportList(Report_TYPE type, const Proc_LIST &processList, const wchar_t *TitleIn)
{
int iReturnCode=DIAGLIB_OK;
std::wstring Title;
ModuleMap modules;
if(TitleIn!=NULL)
Title=TitleIn;
else
Title=L"Module list";
reportPrintHeader2(type, Title.c_str(), REPORT_PROCESS_SEPARATOR);
progressInit(processList.size());
Proc_INFO info;
Proc_LIST::const_iterator itr;
for(itr=processList.begin(); itr!=processList.end(); itr++)
{
if(DIAGLIB_OK == processGetInfo(*itr,&info))
{
for(ModuleSet::const_iterator i=info.modulesLoaded.begin(); i!=info.modulesLoaded.end(); i++)
modules[*i].insert(info.Name);
}
progressIncrement();
}
for(ModuleMap::const_iterator i=modules.begin(); i!=modules.end(); i++)
{
moduleReportInfo(type,i->first,i->second);
moduleContributeInfo(i->first,i->second);
}
progressRelease();
return iReturnCode;
}
示例8: checkModule
bool checkModule(string const & name, bool command)
{
// Cache to avoid slowdown by repated searches
static set<string> failed[2];
// Only add the module if the command was actually defined in the LyX preamble
if (command) {
if (possible_textclass_commands.find('\\' + name) == possible_textclass_commands.end())
return false;
} else {
if (possible_textclass_environments.find(name) == possible_textclass_environments.end())
return false;
}
if (failed[command].find(name) != failed[command].end())
return false;
// Create list of dummy document classes if not already done.
// This is needed since a module cannot be read on its own, only as
// part of a document class.
LayoutFile const & baseClass = LayoutFileList::get()[textclass.name()];
typedef map<string, DocumentClass *> ModuleMap;
static ModuleMap modules;
static bool init = true;
if (init) {
baseClass.load();
DocumentClassBundle & bundle = DocumentClassBundle::get();
LyXModuleList::const_iterator const end = theModuleList.end();
LyXModuleList::const_iterator it = theModuleList.begin();
for (; it != end; it++) {
string const module = it->getID();
LayoutModuleList m;
// FIXME this excludes all modules that depend on another one
if (!m.moduleCanBeAdded(module, &baseClass))
continue;
m.push_back(module);
modules[module] = &bundle.makeDocumentClass(baseClass, m);
}
init = false;
}
// Try to find a module that defines the command.
// Only add it if the definition can be found in the preamble of the
// style that corresponds to the command. This is a heuristic and
// different from the way how we parse the builtin commands of the
// text class (in that case we only compare the name), but it is
// needed since it is not unlikely that two different modules define a
// command with the same name.
ModuleMap::iterator const end = modules.end();
for (ModuleMap::iterator it = modules.begin(); it != end; it++) {
string const module = it->first;
if (!used_modules.moduleCanBeAdded(module, &baseClass))
continue;
if (findLayoutWithoutModule(textclass, name, command))
continue;
if (findInsetLayoutWithoutModule(textclass, name, command))
continue;
DocumentClass const * c = it->second;
Layout const * layout = findLayoutWithoutModule(*c, name, command);
InsetLayout const * insetlayout = layout ? 0 :
findInsetLayoutWithoutModule(*c, name, command);
docstring preamble;
if (layout)
preamble = layout->preamble();
else if (insetlayout)
preamble = insetlayout->preamble();
if (preamble.empty())
continue;
bool add = false;
if (command) {
FullCommand const & cmd =
possible_textclass_commands['\\' + name];
if (preamble.find(cmd.def) != docstring::npos)
add = true;
} else {
FullEnvironment const & env =
possible_textclass_environments[name];
if (preamble.find(env.beg) != docstring::npos &&
preamble.find(env.end) != docstring::npos)
add = true;
}
if (add) {
FileName layout_file = libFileSearch("layouts", module, "module");
if (textclass.read(layout_file, TextClass::MODULE)) {
used_modules.push_back(module);
// speed up further searches:
// the module does not need to be checked anymore.
modules.erase(it);
return true;
}
}
}
failed[command].insert(name);
return false;
}