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


C++ GroupList::end方法代码示例

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


在下文中一共展示了GroupList::end方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: outputHeader

void outputHeader(GroupList& groups, String name)
{
   FILE* file = fopen(name.c_str(),"w");
   if (!file)
      Print("Could not open file " + name);

   // Output all the group name together at the top
   for (GroupList::Iterator grp = groups.begin(); grp != groups.end(); grp++)
         write(file,"#define " + grp->name + "\n");

#if 0 // Types now with the group
   // Output all the types for all the extensions
   for (GroupList::Iterator grp = groups.begin(); grp != groups.end(); grp++)
      for (Array<String>::Iterator itr = grp->types.begin();
            itr != grp->types.end(); itr++)
         write(file,*itr + ";\n");
#endif

   // Output the defines for each group
   for (GroupList::Iterator grp = groups.begin(); grp != groups.end(); grp++) {
      if (!grp->name)
         continue;
      write(file,"\n#ifdef " + grp->name + "\n");
      for (Array<String>::Iterator itr = grp->types.begin();
            itr != grp->types.end(); itr++)
         write(file,*itr + ";\n");
      for (Array<String>::Iterator itr = grp->defines.begin();
            itr != grp->defines.end(); itr++) {
         write(file,"#define " + *itr  + "\n");
      }
      for (Array<String>::Iterator itr = grp->functions.begin();
            itr != grp->functions.end(); itr++) {
         String& str = *itr;

         // Parse function "return name (args)".  Start at the back because
         // args is enclosed in (), the name has no spaces, and the return type
         // can be several tokens, such as "void *" or "const char *"
         int b = str.length();
         int a = b - 1;
         while (str[a] != '(')
            a--;
         while (str[--a] == ' ')
            ;
         b = a;
         while (str[a] != ' ')
            a--;
         String name = str.substr(a+1,b - a);

         //
         write(file,"#define "+name+" XGL_FUNCPTR("+name+")\n");
      }
      write(file,"#endif\n");
   }
}
开发者ID:adhistac,项目名称:ee-client-2-0,代码行数:54,代码来源:parse.cpp

示例2: loadContactList

void ContactsTreeWidget::loadContactList() {
  appInstance->logEvent("ContactsTreeWidget::loadContactList()", SEVERITY_DEBUG);
  GroupList *gl = appInstance->mUser->getGroupList();
  ContactList *cl;
  ContactList::iterator clIt;
  GroupList::iterator glIt;
  appInstance->mainWindow->contactsTree->treeModel->clear();
  for (glIt = gl->begin(); glIt != gl->end(); glIt++) {
    cl = glIt->second.contacts();
    // prevent adding empty "Unauthorized" group
    if(glIt->first != GROUP_INDEX_NOT_AUTHORIZED || !cl->empty()) {
      appInstance->mainWindow->contactsTree->addGroup(glIt->first, glIt->second);
    }
  }
  for (glIt = gl->begin(); glIt != gl->end(); glIt++) {
    cl = glIt->second.contacts();
    for(clIt = cl->begin(); clIt != cl->end(); clIt++) {
      appInstance->mainWindow->contactsTree->addContact(*clIt);
    }
  }
  appInstance->mainWindow->contactsTree->loadAvatars();
}
开发者ID:hamzehpourahmad,项目名称:swift-im,代码行数:22,代码来源:ContactsTreeWidget.cpp

示例3: SortGroups

void CPdpManager::SortGroups()
{
	//here is a little hack to sort the groups into the correct order so that they
	//will save out properly.

	GroupList gListSort = m_GroupList;
	sort(gListSort.begin(), gListSort.end());
	for (int newIdx = 0; newIdx < (int)gListSort.size(); newIdx++)
	{
		if (gListSort[newIdx] != m_GroupList[newIdx])
		{
			int oldIdx = 0;
			for (oldIdx = 0; oldIdx < (int)m_GroupList.size(); oldIdx++)
			{
				if (m_GroupList[oldIdx] == gListSort[newIdx])
				{
					dprintf("%s - old: %d, new: %d\n", m_GroupList[oldIdx].c_str(), oldIdx, newIdx);
					break;
				}
			}
			assert(oldIdx != gListSort.size());

			for (FileListItr itr = m_FileList.begin(); itr != m_FileList.end(); itr++)
			{
				if (itr->nGroupInx == oldIdx)
				{
					//set the new index to the negative value so it doesn't get re-remapped
					itr->nGroupInx = -newIdx;
				}
			}
		}
	}
	m_GroupList = gListSort;

	//fix the negative indexes.
	for (FileListItr itr = m_FileList.begin(); itr != m_FileList.end(); itr++)
	{
		if (itr->nGroupInx < 0)
			itr->nGroupInx = -itr->nGroupInx;
	}

	sort(m_FileList.begin(), m_FileList.end(), CPdpManager::SFileCompare);

	for (FileListItr itr = m_FileList.begin(); itr != m_FileList.end(); itr++)
	{
		dprintf(itr->filename.c_str());
		dprintf("\n");
	}
		
}
开发者ID:lassoan,项目名称:PythonVisualDebugger,代码行数:50,代码来源:PdpManager.cpp

示例4: _handleGroupObjectTimers

bool WorldManager::_handleGroupObjectTimers(uint64 callTime, void* ref)
{
    //iterate through all groups and update the missionwaypoints
    GroupList* groupList = gGroupManager->getGroupList();
    GroupList::iterator it = groupList->begin();

    while(it != groupList->end())
    {
        GroupObject* group = (*it);
        gGroupManager->sendGroupMissionUpdate(group);
        it++;
    }

    return (true);
}
开发者ID:schizix,项目名称:mmoserver,代码行数:15,代码来源:WorldManager.cpp

示例5: loadAvatars

void ContactsTreeWidget::loadAvatars() {
  appInstance->logEvent("ContactsTreeWidget::loadAvatars()", SEVERITY_DEBUG);
  GroupList *gl = appInstance->mUser->getGroupList();
  ContactList *cl;
  ContactList::iterator clIt;
  GroupList::iterator glIt;
  for(glIt = gl->begin(); glIt != gl->end(); glIt++) {
    cl = glIt->second.contacts();
    for(clIt = cl->begin(); clIt != cl->end(); clIt++) {
      if (addedContacts[clIt->getIndex()]) {
        clIt->setAvatar(MrimUtils::prepareAvatar(clIt->getAddress()));
        addedContacts[clIt->getIndex()][columns.contactAvatar] = resizeAvatar(clIt->getAvatar());
      }
    }
  }
}
开发者ID:hamzehpourahmad,项目名称:swift-im,代码行数:16,代码来源:ContactsTreeWidget.cpp

示例6: outputFunctions

void outputFunctions(GroupList& groups, String name)
{
   FILE* file = fopen(name.c_str(),"w");
   if (!file)
      Print("Could not open file " + name);

   // Output the functions for each group
   for (GroupList::Iterator grp = groups.begin(); grp != groups.end(); grp++) {
      if (!grp->name)
         continue;
      if (grp->name == "GL_ARB_imaging")
         // Imaging is include as part of 1.4...
         write(file,"\n#if defined(GL_ARB_imaging) && !defined(GL_VERSION_1_4)\n");
      else
         write(file,"\n#ifdef " + grp->name + "\n");
      write(file,"GL_GROUP_BEGIN(" + grp->name + ")\n");
      for (Array<String>::Iterator itr = grp->functions.begin();
            itr != grp->functions.end(); itr++) {
         String& str = *itr;

         // Parse function "return name (args)".  Start at the back because
         // args is enclosed in (), the name has no spaces, and the return type
         // can be several tokens, such as "void *" or "const char *"
         int b = str.length();
         int a = b - 1;
         while (str[a] != '(')
            a--;
         String args = str.substr(a,b - a);

         while (str[--a] == ' ')
            ;
         b = a;
         while (str[a] != ' ')
            a--;
         String name = str.substr(a+1,b - a);

         while (str[a] == ' ')
            a--;
         String rtype = str.substr(0,a+1);
         //
         write(file,"GL_FUNCTION("+name+","+rtype+","+args+")\n");
      }
      write(file,"GL_GROUP_END()\n#endif\n");
   }
}
开发者ID:adhistac,项目名称:ee-client-2-0,代码行数:45,代码来源:parse.cpp

示例7: GetKeyboardLayoutList

bool
CMSWindowsKeyState::getGroups(GroupList& groups) const
{
	// get keyboard layouts
	UInt32 newNumLayouts = GetKeyboardLayoutList(0, NULL);
	if (newNumLayouts == 0) {
		LOG((CLOG_DEBUG1 "can't get keyboard layouts"));
		return false;
	}
	HKL* newLayouts = new HKL[newNumLayouts];
	newNumLayouts = GetKeyboardLayoutList(newNumLayouts, newLayouts);
	if (newNumLayouts == 0) {
		LOG((CLOG_DEBUG1 "can't get keyboard layouts"));
		delete[] newLayouts;
		return false;
	}

	groups.clear();
	groups.insert(groups.end(), newLayouts, newLayouts + newNumLayouts);
	delete[] newLayouts;
	return true;
}
开发者ID:axelson,项目名称:synergy-plus-depracated,代码行数:22,代码来源:CMSWindowsKeyState.cpp

示例8: ResolveGroups

void cPlayer::ResolveGroups()
{
	// Clear resolved groups first
	m_ResolvedGroups.clear();

	// Get a complete resolved list of all groups the player is in
	std::map< cGroup*, bool > AllGroups;	// Use a map, because it's faster than iterating through a list to find duplicates
	GroupList ToIterate;
	for( GroupList::iterator GroupItr = m_Groups.begin(); GroupItr != m_Groups.end(); ++GroupItr )
	{
		ToIterate.push_back( *GroupItr );
	}
	while( ToIterate.begin() != ToIterate.end() )
	{
		cGroup* CurrentGroup = *ToIterate.begin();
		if( AllGroups.find( CurrentGroup ) != AllGroups.end() )
		{
			LOGWARNING("ERROR: Player \"%s\" is in the group multiple times (\"%s\"). Please fix your settings in users.ini!",
				GetName().c_str(), CurrentGroup->GetName().c_str()
			);
		}
		else
		{
			AllGroups[ CurrentGroup ] = true;
			m_ResolvedGroups.push_back( CurrentGroup );	// Add group to resolved list
			const cGroup::GroupList & Inherits = CurrentGroup->GetInherits();
			for( cGroup::GroupList::const_iterator itr = Inherits.begin(); itr != Inherits.end(); ++itr )
			{
				if( AllGroups.find( *itr ) != AllGroups.end() )
				{
					LOGERROR("ERROR: Player %s is in the same group multiple times due to inheritance (%s). FIX IT!", GetName().c_str(), (*itr)->GetName().c_str() );
					continue;
				}
				ToIterate.push_back( *itr );
			}
		}
		ToIterate.erase( ToIterate.begin() );
	}
}
开发者ID:Kortak,项目名称:MCServer,代码行数:39,代码来源:Player.cpp

示例9: loadDir

void loadDir(GroupList& groups,String name,const char* filter)
{
   DIR *dir = opendir(name);
   if (!dir) {
      Print("Could not open file " + name);
      return;
   }

   struct dirent *fEntry;
   while ((fEntry = readdir(dir)) != 0) {
      if (fEntry->d_name[0] == '.')
         continue;
      String file = name + "/" + String(fEntry->d_name);
      if (filter[0] != '*' && file.find(filter) == String::NPos)
         continue;
      //Print("Loading " + file);
      groups.pushBack(Group());
      if (!loadFile(groups.last(),file))
         groups.popBack();
   }

   quickSort(groups.begin(),groups.end());
}
开发者ID:adhistac,项目名称:ee-client-2-0,代码行数:23,代码来源:parse.cpp


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