当前位置: 首页>>代码示例>>C++>>正文


C++ ModuleMap::begin方法代码示例

本文整理汇总了C++中ModuleMap::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ ModuleMap::begin方法的具体用法?C++ ModuleMap::begin怎么用?C++ ModuleMap::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModuleMap的用法示例。


在下文中一共展示了ModuleMap::begin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
			}
		}
	}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:33,代码来源:MainMenuWindow.cpp

示例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);
 }
开发者ID:robotdm,项目名称:MITK,代码行数:11,代码来源:mitkModuleRegistry.cpp

示例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();
  }
}
开发者ID:robotdm,项目名称:MITK,代码行数:53,代码来源:mitkModuleRegistry.cpp

示例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);
  }
}
开发者ID:robotdm,项目名称:MITK,代码行数:12,代码来源:mitkModuleRegistry.cpp

示例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;
}
开发者ID:Maggunator,项目名称:MITK,代码行数:14,代码来源:usModuleRegistry.cpp

示例6: 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;
}
开发者ID:12019,项目名称:svn.gov.pt,代码行数:37,代码来源:module.cpp

示例7: 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;
}
开发者ID:rpavlik,项目名称:lyx-lucid-backport,代码行数:94,代码来源:tex2lyx.cpp


注:本文中的ModuleMap::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。