本文整理汇总了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");
}
}
示例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();
}
示例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");
}
}
示例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);
}
示例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());
}
}
}
}
示例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");
}
}
示例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;
}
示例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() );
}
}
示例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());
}