void FileDef::writeSummaryLinks(OutputList &ol) { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); QListIterator<LayoutDocEntry> eli( LayoutDocManager::instance().docEntries(LayoutDocManager::File)); LayoutDocEntry *lde; bool first=TRUE; for (eli.toFirst();(lde=eli.current());++eli) { if ((lde->kind()==LayoutDocEntry::FileClasses && classSDict && classSDict->declVisible()) || (lde->kind()==LayoutDocEntry::FileNamespaces && namespaceSDict && namespaceSDict->declVisible()) ) { LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; QCString label = lde->kind()==LayoutDocEntry::FileClasses ? "nested-classes" : "namespaces"; writeSummaryLink(ol,label,ls->title,first); } else if (lde->kind()==LayoutDocEntry::MemberDecl) { LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; MemberList * ml = getMemberList(lmd->type); if (ml && ml->declVisible()) { writeSummaryLink(ol,ml->listTypeAsString(),lmd->title,first); } } } if (!first) { ol.writeString(" </div>\n"); } ol.popGeneratorState(); }
void NamespaceDef::addListReferences() { //bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); { QList<ListItemInfo> *xrefItems = xrefListItems(); addRefItem(xrefItems, qualifiedName(), getLanguage()==SrcLangExt_Fortran ? theTranslator->trModule(TRUE,TRUE) : theTranslator->trNamespace(TRUE,TRUE), getOutputFileBase(),displayName(), 0, this ); } MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (; (mg=mgli.current()); ++mgli) { mg->addListReferences(this); } QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (mli.toFirst(); (ml=mli.current()); ++mli) { if (ml->listType()&MemberListType_documentationLists) { ml->addListReferences(this); } } }
void GroupDef::addListReferences() { { LockingPtr< QList<ListItemInfo> > xrefItems = xrefListItems(); addRefItem(xrefItems.pointer(), getOutputFileBase(), theTranslator->trGroup(TRUE,TRUE), getOutputFileBase(),name(), 0 ); } MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { mg->addListReferences(this); } QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (mli.toFirst();(ml=mli.current());++mli) { if (ml->listType()&MemberList::documentationLists) { ml->addListReferences(this); } } }
void CDoodChatManagerModel::updateGroupMems(MemberList list) { int len = list.size(); qDebug()<<Q_FUNC_INFO<<"size:"<<list.size(); if(list.size()>0){ mGroupMemList.clear(); } for(int i = 0;i<len;++i){ Member mem = list.at(i); if(mem.thumbAvatar != "" && !mem.thumbAvatar.startsWith("/data")){ mem.thumbAvatar = QString::fromStdString(APP_DATA_PATH)+"public/head/"+mem.thumbAvatar; } mGroupMemList.push_back(mem); } mGroupSize = list.size(); QList<CDoodChatItem*> msgList = m_pChatMap.values(); for(int i =0;i<msgList.size();++i){ CDoodChatItem* item = msgList.at(i); if((item != NULL && item->name() == item->fromId())||item != NULL && item->contactThumbAvatar() == ""){ for(int j=0;j<mGroupMemList.size();++j){ if(mGroupMemList.at(j).id == item->fromId()){ item->setName(mGroupMemList.at(j).name); if(mGroupMemList.at(j).thumbAvatar != ""){ item->setContactThumbAvatar(mGroupMemList.at(j).thumbAvatar); } break; } } } } emit nameChanged(); }
void NamespaceDef::addMembersToMemberGroup() { QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (mli.toFirst(); (ml=mli.current()); ++mli) { if (ml->listType()&MemberListType_declarationLists) { ::addMembersToMemberGroup(ml,&memberGroupSDict,this); } } // add members inside sections to their groups if (memberGroupSDict) { MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (; (mg=mgli.current()); ++mgli) { if (mg->allMembersInSameSection() && m_subGrouping) { //printf("----> addToDeclarationSection(%s)\n",mg->header().data()); mg->addToDeclarationSection(); } } } }
void GroupDef::sortMemberLists() { MemberList *ml = m_memberLists.first(); while (ml) { if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); } ml = m_memberLists.next(); } }
void GroupDef::sortMemberLists() { QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (;(ml=mli.current());++mli) { if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); } } }
void GroupDef::addMemberToList(MemberList::ListType lt,MemberDef *md) { static bool sortBriefDocs = Config_getBool("SORT_BRIEF_DOCS"); static bool sortMemberDocs = Config_getBool("SORT_MEMBER_DOCS"); MemberList *ml = createMemberList(lt); ml->setNeedsSorting( ((ml->listType()&MemberList::declarationLists) && sortBriefDocs) || ((ml->listType()&MemberList::documentationLists) && sortMemberDocs)); ml->append(md); }
void CDoodChatManagerModel::addGroupMems(MemberList mems) { if(mems.size()<=0){ return; } if(mems[0].groupid == id()){ for(int i =0;i<mems.size();++i){ mGroupMemList.push_back(mems[i]); } } }
/*! Adds member definition \a md to the list of all members of this file */ void FileDef::insertMember(MemberDef *md) { if (md->isHidden()) return; //printf("%s:FileDef::insertMember(%s (=%p) list has %d elements)\n", // name().data(),md->name().data(),md,allMemberList.count()); MemberList *allMemberList = getMemberList(MemberList::allMembersList); if (allMemberList && allMemberList->findRef(md)!=-1) // TODO optimize the findRef! { return; } if (allMemberList==0) { allMemberList = new MemberList(MemberList::allMembersList);; m_memberLists.append(allMemberList); } allMemberList->append(md); //::addFileMemberNameToIndex(md); switch (md->memberType()) { case MemberDef::Variable: case MemberDef::Property: addMemberToList(MemberList::decVarMembers,md); addMemberToList(MemberList::docVarMembers,md); break; case MemberDef::Function: addMemberToList(MemberList::decFuncMembers,md); addMemberToList(MemberList::docFuncMembers,md); break; case MemberDef::Typedef: addMemberToList(MemberList::decTypedefMembers,md); addMemberToList(MemberList::docTypedefMembers,md); break; case MemberDef::Enumeration: addMemberToList(MemberList::decEnumMembers,md); addMemberToList(MemberList::docEnumMembers,md); break; case MemberDef::EnumValue: // enum values are shown inside their enums break; case MemberDef::Define: addMemberToList(MemberList::decDefineMembers,md); addMemberToList(MemberList::docDefineMembers,md); break; default: err("FileDef::insertMembers(): " "member `%s' with class scope `%s' inserted in file scope `%s'!\n", md->name().data(), md->getClassDef() ? md->getClassDef()->name().data() : "<global>", name().data()); } //addMemberToGroup(md,groupId); }
MemberList *NamespaceDef::getMemberList(MemberListType lt) const { QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (mli.toFirst(); (ml=mli.current()); ++mli) { if (ml->listType()==lt) { return ml; } } return 0; }
void NamespaceDef::insertMember(MemberDef *md) { if (md->isHidden()) return; MemberList *allMemberList = getMemberList(MemberListType_allMembersList); if (allMemberList==0) { allMemberList = new MemberList(MemberListType_allMembersList); m_memberLists.append(allMemberList); } allMemberList->append(md); if (m_allMembersDict==0) { m_allMembersDict = new MemberSDict; } //printf("%s::m_allMembersDict->append(%s)\n",name().data(),md->localName().data()); m_allMembersDict->append(md->localName(),md); //::addNamespaceMemberNameToIndex(md); //static bool sortBriefDocs=Config_getBool("SORT_BRIEF_DOCS"); switch(md->memberType()) { case MemberType_Variable: addMemberToList(MemberListType_decVarMembers,md); addMemberToList(MemberListType_docVarMembers,md); break; case MemberType_Function: addMemberToList(MemberListType_decFuncMembers,md); addMemberToList(MemberListType_docFuncMembers,md); break; case MemberType_Typedef: addMemberToList(MemberListType_decTypedefMembers,md); addMemberToList(MemberListType_docTypedefMembers,md); break; case MemberType_Enumeration: addMemberToList(MemberListType_decEnumMembers,md); addMemberToList(MemberListType_docEnumMembers,md); break; case MemberType_EnumValue: break; case MemberType_Define: addMemberToList(MemberListType_decDefineMembers,md); addMemberToList(MemberListType_docDefineMembers,md); break; default: err("NamespaceDef::insertMembers(): " "member `%s' with class scope `%s' inserted in namespace scope `%s'!\n", md->name().data(), md->getClassDef() ? md->getClassDef()->name().data() : "", name().data()); } }
MemberList *GroupDef::getMemberList(MemberList::ListType lt) const { GroupDef *that = (GroupDef*)this; MemberList *ml = that->m_memberLists.first(); while (ml) { if (ml->listType()==lt) { return ml; } ml = that->m_memberLists.next(); } return 0; }
MemberList *NamespaceDef::getMemberList(MemberListType lt) const { NamespaceDef *that = (NamespaceDef*)this; MemberList *ml = that->m_memberLists.first(); while (ml) { if (ml->listType()==lt) { return ml; } ml = that->m_memberLists.next(); } return 0; }
MemberList *unmarshalMemberList(StorageIntf *s) { uint i; uint count = unmarshalUInt(s); if (count==NULL_LIST) return 0; MemberList *result = new MemberList; assert(count<1000000); for (i=0;i<count;i++) { MemberDef *md = (MemberDef*)unmarshalObjPointer(s); result->append(md); } result->unmarshal(s); return result; }
void GroupDef::writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title) { static bool optimizeVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); MemberList * ml = getMemberList(lt); if (optimizeVhdl && ml) { VhdlDocGen::writeVhdlDeclarations(ml,ol,this,0,0,0); return; } if (ml) { ml->writeDeclarations(ol,0,0,0,this,title,0); } }
void NamespaceDef::writeMemberPages(OutputList &ol) { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (mli.toFirst(); (ml=mli.current()); ++mli) { if (ml->listType()&MemberListType_documentationLists) { ml->writeDocumentationPage(ol,displayName(),this); } } ol.popGeneratorState(); }
void FileDef::writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title) { static bool optVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); MemberList * ml = getMemberList(lt); if (ml) { if (optVhdl) // use specific declarations function { VhdlDocGen::writeVhdlDeclarations(ml,ol,0,0,this); } else { ml->writeDeclarations(ol,0,0,this,0,title,0); } } }
bool simple_slist_test() { //Define an slist that will store MyClass using the public base hook typedef any_to_slist_hook< base_hook< any_base_hook<> > >BaseOption; typedef slist<MyClass, BaseOption, constant_time_size<false> > BaseList; //Define an slist that will store MyClass using the public member hook typedef any_to_slist_hook< member_hook<MyClass, any_member_hook<>, &MyClass::member_hook_> > MemberOption; typedef slist<MyClass, MemberOption> MemberList; typedef std::vector<MyClass>::iterator VectIt; typedef std::vector<MyClass>::reverse_iterator VectRit; //Create several MyClass objects, each one with a different value std::vector<MyClass> values; for(int i = 0; i < 100; ++i) values.push_back(MyClass(i)); BaseList baselist; MemberList memberlist; //Now insert them in the reverse order in the base hook list for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it) baselist.push_front(*it); //Now insert them in the same order as in vector in the member hook list for(BaseList::iterator it(baselist.begin()), itend(baselist.end()) ; it != itend; ++it) { memberlist.push_front(*it); } //Now test lists { BaseList::iterator bit(baselist.begin()); MemberList::iterator mit(memberlist.begin()); VectRit rit(values.rbegin()), ritend(values.rend()); VectIt it(values.begin()), itend(values.end()); //Test the objects inserted in the base hook list for(; rit != ritend; ++rit, ++bit) if(&*bit != &*rit) return false; //Test the objects inserted in the member hook list for(; it != itend; ++it, ++mit) if(&*mit != &*it) return false; } return true; }
MemberList GroupControler::MemberToQMemberList(std::vector<std::shared_ptr<service::User> > members) { MemberList memberList; for(auto i: members){ if(i == NULL){ continue; } Member member; std::shared_ptr<service::Member> mem = std::dynamic_pointer_cast<service::Member>(i); if(mem == NULL){ continue; } member.avatar=QString::fromStdString(mem->avatar); if(mem->gender==1){ member.gender="男"; } else if(mem->gender==2){ member.gender="女"; } else{ member.gender="保密"; } member.groupid=QString::number(mem->groupid); member.id=QString::number(mem->id); member.member_type=QString::number(mem->member_type); member.name=QString::fromStdString(mem->name); member.remark=QString::fromStdString(mem->remark); if(member.remark=="#"){ member.remark=member.name; } std::string str=""; char c=mem->team; char sz[5] = {c}; str=sz; if(str.length()>0){ if(str[0]<'A'||str[0]>'Z'){ str[0]='#'; } } member.team=QString::fromStdString(str); if(mem->thumb_avatar!=""){ member.thumbAvatar="/data/data/com.vrv.linkDood/public/head/"+QString::fromStdString(mem->thumb_avatar); } memberList.push_back(member); } return memberList; }
void NamespaceDef::sortMemberLists() { QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (mli.toFirst();(ml=mli.current());++mli) { if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); } } if (classSDict) { classSDict->sort(); } if (namespaceSDict) { namespaceSDict->sort(); } }
MemberList *NamespaceDef::createMemberList(MemberListType lt) { m_memberLists.setAutoDelete(TRUE); QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (mli.toFirst(); (ml=mli.current()); ++mli) { if (ml->listType()==lt) { return ml; } } // not found, create a new member list ml = new MemberList(lt); m_memberLists.append(ml); return ml; }
void GroupDef::writeSummaryLinks(OutputList &ol) { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); QListIterator<LayoutDocEntry> eli( LayoutDocManager::instance().docEntries(LayoutDocManager::Group)); LayoutDocEntry *lde; bool first=TRUE; SrcLangExt lang = getLanguage(); for (eli.toFirst();(lde=eli.current());++eli) { if ((lde->kind()==LayoutDocEntry::GroupClasses && classSDict->declVisible()) || (lde->kind()==LayoutDocEntry::GroupNamespaces && namespaceSDict->declVisible()) || (lde->kind()==LayoutDocEntry::GroupFiles && fileList->count()>0) || (lde->kind()==LayoutDocEntry::GroupNestedGroups && groupList->count()>0) || (lde->kind()==LayoutDocEntry::GroupDirs && dirList->count()>0) ) { LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; QCString label = lde->kind()==LayoutDocEntry::GroupClasses ? "nested-classes" : lde->kind()==LayoutDocEntry::GroupNamespaces ? "namespaces" : lde->kind()==LayoutDocEntry::GroupFiles ? "files" : lde->kind()==LayoutDocEntry::GroupNestedGroups ? "groups" : "dirs"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()==LayoutDocEntry::MemberDecl) { LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; MemberList * ml = getMemberList(lmd->type); if (ml && ml->declVisible()) { ol.writeSummaryLink(0,MemberList::listTypeAsString(ml->listType()),lmd->title(lang),first); first=FALSE; } } } if (!first) { ol.writeString(" </div>\n"); } ol.popGeneratorState(); }
void add_node(int cnt) { int af = AF_INET; int addr[NODE_CNT]; unsigned short port[NODE_CNT]; std::iota(addr, addr+NODE_CNT, 1); std::iota(port, port+NODE_CNT, 10001); for (int i=0; i<NODE_CNT; i++) { memlst.add_node(af, (unsigned char*)(addr+i), port[i], -1); } traverse(); memlst.del_node(af, (unsigned char*)(addr+1), port[1]); memlst.update_node_heartbeat(af, (unsigned char*)(addr+3), port[3], 11); traverse(); }
void NamespaceDef::findSectionsInDocumentation() { docFindSections(documentation(),this,0,docFile()); MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (; (mg=mgli.current()); ++mgli) { mg->findSectionsInDocumentation(); } QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (mli.toFirst(); (ml=mli.current()); ++mli) { if (ml->listType()&MemberListType_declarationLists) { ml->findSectionsInDocumentation(); } } }
static void generateSqlite3ForNamespace(sqlite3 *db, NamespaceDef *nd) { // + contained class definitions // + contained namespace definitions // + member groups // + normal members // - brief desc // - detailed desc // - location // - files containing (parts of) the namespace definition if (nd->isReference() || nd->isHidden()) return; // skip external references // + contained class definitions writeInnerClasses(db,nd->getClassSDict()); // + contained namespace definitions writeInnerNamespaces(db,nd->getNamespaceSDict()); // + member groups if (nd->getMemberGroupSDict()) { MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict()); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { generateSqlite3Section(db,nd,mg->members(),"user-defined",mg->header(), mg->documentation()); } } // + normal members QListIterator<MemberList> mli(nd->getMemberLists()); MemberList *ml; for (mli.toFirst();(ml=mli.current());++mli) { if ((ml->listType()&MemberListType_declarationLists)!=0) { generateSqlite3Section(db,nd,ml,"user-defined");//g_xmlSectionMapper.find(ml->listType())); } } }
void GroupDef::addMembersToMemberGroup() { QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (mli.toFirst();(ml=mli.current());++mli) { if (ml->listType()&MemberList::declarationLists) { ::addMembersToMemberGroup(ml,&memberGroupSDict,this); } } //printf("GroupDef::addMembersToMemberGroup() memberGroupList=%d\n",memberGroupList->count()); MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { mg->setInGroup(TRUE); } }
void CDoodMemberManager::onMemberListChanged(QString operType, QString GroupId, MemberList memberlist) { qDebug() << Q_FUNC_INFO<<"sss"; if(operType=="32"||operType=="33"){ for(size_t i=0;i<memberlist.size();++i){ qDebug() << Q_FUNC_INFO<<"sss1"<<memberlist[i].id<<memberlist[i].name; CDoodMemberItem *item = memberListMap.value(memberlist[i].id,NULL); if(item!=NULL){ qDebug() << Q_FUNC_INFO<<"sss2"; if(item->groupid()==GroupId){ qDebug() << Q_FUNC_INFO<<"sss3"; removeMemberItem(memberlist[i].id); int size; size=memberSize().toInt()-1; setMemberSize(QString::number(size)); } } item=groupAdminListMap.value(memberlist[i].id,NULL); if(item!=NULL){ if(memberlist[i].groupid==GroupId){ removeMemberItem(memberlist[i].id); int size; size=memberSize().toInt()-1; setMemberSize(QString::number(size)); } } } } if(operType=="1"){ if(GroupId==mGroupid){ for(size_t i=0;i<memberlist.size();++i){ addMember(memberlist[i]); emit itemCountChanged(); } int size; size=memberSize().toInt()+memberlist.size(); setMemberSize(QString::number(size)); } } }
int main() { typedef std::vector<MyClass>::iterator VectIt; typedef std::vector<MyClass>::reverse_iterator VectRit; //Create several MyClass objects, each one with a different value std::vector<MyClass> values; for(int i = 0; i < 100; ++i) values.push_back(MyClass(i)); BaseList baselist; MemberList memberlist; //Now insert them in the reverse order in the base hook list for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it) baselist.push_front(*it); //Now insert them in the same order as in vector in the member hook list for(BaseList::iterator it(baselist.begin()), itend(baselist.end()) ; it != itend; ++it){ memberlist.push_front(*it); } //Now test lists { BaseList::iterator bit(baselist.begin()), bitend(baselist.end()); MemberList::iterator mit(memberlist.begin()), mitend(memberlist.end()); VectRit rit(values.rbegin()), ritend(values.rend()); VectIt it(values.begin()), itend(values.end()); //Test the objects inserted in the base hook list for(; rit != ritend; ++rit, ++bit) if(&*bit != &*rit) return 1; //Test the objects inserted in the member hook list for(; it != itend; ++it, ++mit) if(&*mit != &*it) return 1; } return 0; }
void CDoodMemberManager::onGetMemberListResult(QString result, MemberList memberList) { if(result=="获取成员列表成功"){ if(memberList.size()>0){ if(memberList[0].groupid==m_ThePresentGroupid){ setMemberSize(QString::number(memberList.size())); mMy_Id=getMyId(); setMy_Type("1"); for(size_t i=0;i<memberList.size();i++) { mGroupid=memberList[0].groupid; addMember(memberList[i]); emit itemCountChanged(); } emit getMemberListResult("获取成员列表成功"); } } } else{ emit getMemberListResult("获取成员列表失败"); } }