diff options
Diffstat (limited to 'src/memberlist.h')
-rw-r--r-- | src/memberlist.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/memberlist.h b/src/memberlist.h index 200767d..d2433f4 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -17,6 +17,7 @@ #define MEMBERLIST_H #include <vector> +#include <algorithm> #include <qlist.h> #include "memberdef.h" @@ -131,6 +132,25 @@ class MemberLinkedRefMap : public LinkedRefMap<const MemberDef> { }; +class MemberLists : public std::vector<MemberList> +{ + public: + MemberLists() = default; + MemberList &get(MemberListType lt) + { + // find the list with the given type + auto it = std::find_if(begin(),end(),[<](const auto &ml) { return ml.listType()==lt; }); + if (it!=end()) return *it; + // or create a new list if it is not found + emplace_back(lt); + return back(); + } + + private: + MemberLists(const MemberLists &) = delete; + MemberLists &operator=(const MemberLists &) = delete; +}; + int genericCompareMembers(const MemberDef *c1,const MemberDef *c2); #endif |