diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2009-10-27 20:10:16 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2009-10-27 20:10:16 (GMT) |
commit | 0c751ba9f9a73ad649bf64cef4c9fdb82743b2f6 (patch) | |
tree | 7b31e0941321a116a730c80e26726da9202178c3 /src/index.h | |
parent | 1042ef3a191bd0f399f1a2a20fe259c14fe6faf9 (diff) | |
download | Doxygen-0c751ba9f9a73ad649bf64cef4c9fdb82743b2f6.zip Doxygen-0c751ba9f9a73ad649bf64cef4c9fdb82743b2f6.tar.gz Doxygen-0c751ba9f9a73ad649bf64cef4c9fdb82743b2f6.tar.bz2 |
Release-1.6.1-20091027
Diffstat (limited to 'src/index.h')
-rw-r--r-- | src/index.h | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/src/index.h b/src/index.h index 72ac764..bb62520 100644 --- a/src/index.h +++ b/src/index.h @@ -22,11 +22,12 @@ #include <qfile.h> #include <qlist.h> +class Definition; class MemberDef; class OutputList; class QTextStream; - +/** \brief Abstract interface for index generators. */ class IndexIntf { public: @@ -37,44 +38,56 @@ class IndexIntf virtual void decContentsDepth() = 0; virtual void addContentsItem(bool isDir, const char *name, const char *ref = 0, const char *file = 0, const char *anchor = 0) = 0; - virtual void addIndexItem(const char *level1, const char *level2, const char *contRef, - const char *memRef, const char *anchor,const MemberDef *md) = 0; + virtual void addIndexItem(Definition *context,MemberDef *md, + const char *anchor,const char *word) = 0; virtual void addIndexFile(const char *name) = 0; virtual void addImageFile(const char *name) = 0; virtual void addStyleSheetFile(const char *name) = 0; }; +/** \brief A list of index interfaces. + * + * This class itself implements all methods of IndexIntf and + * just forwards the calls to all items in the list. + */ class IndexList : public IndexIntf { private: QList<IndexIntf> m_intfs; + // --- foreach implementations for various number of arguments + void foreach(void (IndexIntf::*methodPtr)()) { QListIterator<IndexIntf> li(m_intfs); for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(); } + template<typename A1> void foreach(void (IndexIntf::*methodPtr)(A1),A1 a1) { QListIterator<IndexIntf> li(m_intfs); for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1); } - template<typename A1,typename A2,typename A3,typename A4,typename A5> - void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5) + + template<typename A1,typename A2,typename A3,typename A4> + void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4),A1 a1,A2 a2,A3 a3,A4 a4) { QListIterator<IndexIntf> li(m_intfs); - for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5); + for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4); } - template<typename A1,typename A2,typename A3,typename A4,typename A5,typename A6> - void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5,A6),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6) + + template<typename A1,typename A2,typename A3,typename A4,typename A5> + void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5) { QListIterator<IndexIntf> li(m_intfs); - for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5,a6); + for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5); } public: + /** Creates a list of indexes */ IndexList() { m_intfs.setAutoDelete(TRUE); } + /** Add an index generator to the list */ void addIndex(IndexIntf *intf) { m_intfs.append(intf); } @@ -91,10 +104,10 @@ class IndexList : public IndexIntf const char *file = 0, const char *anchor = 0) { foreach<bool,const char *,const char *,const char *,const char*> (&IndexIntf::addContentsItem,isDir,name,ref,file,anchor); } - void addIndexItem(const char *level1, const char *level2, const char *contRef, - const char *memRef, const char *anchor,const MemberDef *md) - { foreach<const char *,const char *,const char *,const char *,const char *,const MemberDef *> - (&IndexIntf::addIndexItem,level1,level2,contRef,memRef,anchor,md); } + void addIndexItem(Definition *context,MemberDef *md, + const char *anchor=0,const char *word=0) + { foreach<Definition *,MemberDef *> + (&IndexIntf::addIndexItem,context,md,anchor,word); } void addIndexFile(const char *name) { foreach<const char *>(&IndexIntf::addIndexFile,name); } void addImageFile(const char *name) |