Imported Upstream version 1.8.8
[platform/upstream/doxygen.git] / src / context.h
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2014 by Dimitri van Heesch.
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation under the terms of the GNU General Public License is hereby
7  * granted. No representations are made about the suitability of this software
8  * for any purpose. It is provided "as is" without express or implied warranty.
9  * See the GNU General Public License for more details.
10  *
11  * Documents produced by Doxygen are derivative works derived from the
12  * input used in their production; they are not affected by this license.
13  *
14  */
15
16 #ifndef CONTEXT_H
17 #define CONTEXT_H
18
19 #include "types.h"
20 #include "template.h"
21 #include <qlist.h>
22 #include <stdio.h>
23
24 class Definition;
25 class ClassDef;
26 class ClassSDict;
27 class BaseClassList;
28 class PageDef;
29 class GroupDef;
30 class NamespaceDef;
31 class BaseClassList;
32 class NamespaceSDict;
33 class FileDef;
34 class FileList;
35 class FileNameList;
36 class DirSDict;
37 class DirList;
38 class DirDef;
39 class PageSDict;
40 class GroupSDict;
41 class GroupDef;
42 class GroupList;
43 struct IncludeInfo;
44 class MemberList;
45 class MemberSDict;
46 class MemberDef;
47 struct Argument;
48 class ArgumentList;
49 class MemberNameInfoSDict;
50 struct MemberInfo;
51 class MemberGroup;
52 class MemberGroupSDict;
53 class MemberGroupList;
54
55 //----------------------------------------------------
56
57 #define DEBUG_REF 0
58
59 /** @brief Helper class to support reference counting */
60 #if DEBUG_REF
61 class RefCountedContext
62 {
63   public:
64     RefCountedContext(const char *className) : m_refCount(0)
65     {
66       m_className=className;
67       m_insideRelease = FALSE;
68     }
69     ~RefCountedContext()
70     {
71       if (!m_insideRelease) abort();
72     }
73     int addRef()
74     {
75       ++s_totalCount;
76       printf("%p:%s::addRef()=%d\n",this,m_className.data(),m_refCount);
77       return ++m_refCount;
78     }
79     int release()
80     {
81       --s_totalCount;
82       printf("%p:%s::release()=%d\n",this,m_className.data(),m_refCount-1);
83       int count = --m_refCount;
84       if (count<=0)
85       {
86         m_insideRelease=TRUE;
87         delete this;
88       }
89       return count;
90     }
91   private:
92     int m_refCount;
93     QCString m_className;
94     bool m_insideRelease;
95   public:
96     static int s_totalCount;
97 };
98
99 #else // release version
100
101 class RefCountedContext
102 {
103   public:
104     RefCountedContext(const char *) : m_refCount(0) {}
105     virtual ~RefCountedContext() {}
106     int addRef() { return ++m_refCount; }
107     int release()
108     {
109       int count = --m_refCount;
110       if (count<=0)
111       {
112         delete this;
113       }
114       return count;
115     }
116   private:
117     int m_refCount;
118 };
119 #endif
120
121
122 //----------------------------------------------------
123
124 class ConfigContext : public RefCountedContext, public TemplateStructIntf
125 {
126   public:
127     static ConfigContext *alloc() { return new ConfigContext; }
128
129     // TemplateStructIntf methods
130     virtual TemplateVariant get(const char *name) const;
131     virtual int addRef()  { return RefCountedContext::addRef(); }
132     virtual int release() { return RefCountedContext::release(); }
133
134   private:
135     ConfigContext();
136    ~ConfigContext();
137     class Private;
138     Private *p;
139 };
140
141 //----------------------------------------------------
142
143 class DoxygenContext : public RefCountedContext, public TemplateStructIntf
144 {
145   public:
146     static DoxygenContext *alloc() { return new DoxygenContext; }
147
148     // TemplateStructIntf methods
149     virtual TemplateVariant get(const char *name) const;
150     virtual int addRef()  { return RefCountedContext::addRef(); }
151     virtual int release() { return RefCountedContext::release(); }
152
153   private:
154     DoxygenContext();
155     ~DoxygenContext();
156     class Private;
157     Private *p;
158 };
159
160 //----------------------------------------------------
161
162 class TranslateContext : public RefCountedContext, public TemplateStructIntf
163 {
164   public:
165     static TranslateContext *alloc() { return new TranslateContext; }
166
167     // TemplateStructIntf methods
168     virtual TemplateVariant get(const char *name) const;
169     virtual int addRef()  { return RefCountedContext::addRef(); }
170     virtual int release() { return RefCountedContext::release(); }
171
172   private:
173     TranslateContext();
174    ~TranslateContext();
175     class Private;
176     Private *p;
177 };
178
179 //----------------------------------------------------
180
181 class UsedFilesContext : public RefCountedContext, public TemplateListIntf
182 {
183   public:
184     static UsedFilesContext *alloc(ClassDef *cd) { return new UsedFilesContext(cd); }
185
186     // TemplateListIntf
187     virtual int count() const;
188     virtual TemplateVariant at(int index) const;
189     virtual TemplateListIntf::ConstIterator *createIterator() const;
190     virtual int addRef()  { return RefCountedContext::addRef(); }
191     virtual int release() { return RefCountedContext::release(); }
192
193     void addFile(FileDef *fd);
194
195   private:
196     UsedFilesContext(ClassDef *cd);
197    ~UsedFilesContext();
198
199     class Private;
200     Private *p;
201 };
202
203 //----------------------------------------------------
204
205 class IncludeInfoContext : public RefCountedContext, public TemplateStructIntf
206 {
207   public:
208     static IncludeInfoContext *alloc(const IncludeInfo *info,SrcLangExt lang)
209     { return new IncludeInfoContext(info,lang); }
210
211     // TemplateStructIntf methods
212     virtual TemplateVariant get(const char *name) const;
213     virtual int addRef()  { return RefCountedContext::addRef(); }
214     virtual int release() { return RefCountedContext::release(); }
215
216   private:
217     IncludeInfoContext(const IncludeInfo *,SrcLangExt lang);
218    ~IncludeInfoContext();
219     class Private;
220     Private *p;
221 };
222
223 //----------------------------------------------------
224
225 class IncludeInfoListContext : public RefCountedContext, public TemplateListIntf
226 {
227   public:
228     static IncludeInfoListContext *alloc(const QList<IncludeInfo> &list,SrcLangExt lang)
229     { return new IncludeInfoListContext(list,lang); }
230
231     // TemplateListIntf
232     virtual int count() const;
233     virtual TemplateVariant at(int index) const;
234     virtual TemplateListIntf::ConstIterator *createIterator() const;
235     virtual int addRef()  { return RefCountedContext::addRef(); }
236     virtual int release() { return RefCountedContext::release(); }
237
238   private:
239     IncludeInfoListContext(const QList<IncludeInfo> &list,SrcLangExt lang);
240    ~IncludeInfoListContext();
241     class Private;
242     Private *p;
243 };
244
245
246 //----------------------------------------------------
247
248 class ClassContext : public RefCountedContext, public TemplateStructIntf
249 {
250   public:
251     static ClassContext *alloc(ClassDef *cd) { return new ClassContext(cd); }
252
253     // TemplateStructIntf methods
254     virtual TemplateVariant get(const char *name) const;
255     virtual int addRef()  { return RefCountedContext::addRef(); }
256     virtual int release() { return RefCountedContext::release(); }
257
258   private:
259     ClassContext(ClassDef *);
260    ~ClassContext();
261     class Private;
262     Private *p;
263 };
264
265 //----------------------------------------------------
266
267 class NamespaceContext : public RefCountedContext, public TemplateStructIntf
268 {
269   public:
270     static NamespaceContext *alloc(NamespaceDef *nd) { return new NamespaceContext(nd); }
271
272     // TemplateStructIntf methods
273     virtual TemplateVariant get(const char *name) const;
274     virtual int addRef()  { return RefCountedContext::addRef(); }
275     virtual int release() { return RefCountedContext::release(); }
276
277   private:
278     NamespaceContext(NamespaceDef *);
279    ~NamespaceContext();
280     class Private;
281     Private *p;
282 };
283
284 //----------------------------------------------------
285
286 class FileContext : public RefCountedContext, public TemplateStructIntf
287 {
288   public:
289     static FileContext *alloc(FileDef *fd) { return new FileContext(fd); }
290
291     // TemplateStructIntf methods
292     virtual TemplateVariant get(const char *name) const;
293     virtual int addRef()  { return RefCountedContext::addRef(); }
294     virtual int release() { return RefCountedContext::release(); }
295
296   private:
297     FileContext(FileDef *);
298    ~FileContext();
299     class Private;
300     Private *p;
301 };
302 //----------------------------------------------------
303
304 class DirContext : public RefCountedContext, public TemplateStructIntf
305 {
306   public:
307     static DirContext *alloc(DirDef *dd) { return new DirContext(dd); }
308
309     // TemplateStructIntf methods
310     virtual TemplateVariant get(const char *name) const;
311     virtual int addRef()  { return RefCountedContext::addRef(); }
312     virtual int release() { return RefCountedContext::release(); }
313
314   private:
315     DirContext(DirDef *);
316    ~DirContext();
317     class Private;
318     Private *p;
319 };
320
321
322 //----------------------------------------------------
323
324 class PageContext : public RefCountedContext, public TemplateStructIntf
325 {
326   public:
327     static PageContext *alloc(PageDef *pd,bool isMainPage=FALSE) { return new PageContext(pd,isMainPage); }
328
329     // TemplateStructIntf methods
330     virtual TemplateVariant get(const char *name) const;
331     virtual int addRef()  { return RefCountedContext::addRef(); }
332     virtual int release() { return RefCountedContext::release(); }
333
334   private:
335     PageContext(PageDef *,bool isMainPage);
336    ~PageContext();
337     class Private;
338     Private *p;
339 };
340
341 //----------------------------------------------------
342
343 class MemberContext : public RefCountedContext, public TemplateStructIntf
344 {
345   public:
346     static MemberContext *alloc(MemberDef *md) { return new MemberContext(md); }
347
348     // TemplateStructIntf methods
349     virtual TemplateVariant get(const char *name) const;
350     virtual int addRef()  { return RefCountedContext::addRef(); }
351     virtual int release() { return RefCountedContext::release(); }
352
353   private:
354     MemberContext(MemberDef *);
355    ~MemberContext();
356     class Private;
357     Private *p;
358 };
359
360
361 //----------------------------------------------------
362
363 class ModuleContext : public RefCountedContext, public TemplateStructIntf
364 {
365   public:
366     static ModuleContext *alloc(GroupDef *gd) { return new ModuleContext(gd); }
367
368     // TemplateStructIntf methods
369     virtual TemplateVariant get(const char *name) const;
370     virtual int addRef()  { return RefCountedContext::addRef(); }
371     virtual int release() { return RefCountedContext::release(); }
372
373   private:
374     ModuleContext(GroupDef *);
375    ~ModuleContext();
376     class Private;
377     Private *p;
378 };
379
380 //----------------------------------------------------
381
382 class ClassListContext : public RefCountedContext, public TemplateListIntf
383 {
384   public:
385     static ClassListContext *alloc() { return new ClassListContext; }
386
387     // TemplateListIntf
388     virtual int  count() const;
389     virtual TemplateVariant at(int index) const;
390     virtual TemplateListIntf::ConstIterator *createIterator() const;
391     virtual int addRef()  { return RefCountedContext::addRef(); }
392     virtual int release() { return RefCountedContext::release(); }
393
394   private:
395     ClassListContext();
396    ~ClassListContext();
397     class Private;
398     Private *p;
399 };
400
401 //----------------------------------------------------
402
403 class ClassIndexContext : public RefCountedContext, public TemplateStructIntf
404 {
405   public:
406     static ClassIndexContext *alloc() { return new ClassIndexContext; }
407
408     // TemplateStructIntf methods
409     virtual TemplateVariant get(const char *name) const;
410     virtual int addRef()  { return RefCountedContext::addRef(); }
411     virtual int release() { return RefCountedContext::release(); }
412
413   private:
414     ClassIndexContext();
415    ~ClassIndexContext();
416     class Private;
417     Private *p;
418 };
419
420 //----------------------------------------------------
421
422 class ClassInheritanceNodeContext : public RefCountedContext, public TemplateStructIntf
423 {
424   public:
425     static ClassInheritanceNodeContext *alloc(ClassDef *cd)
426     { return new ClassInheritanceNodeContext(cd); }
427
428     // TemplateStructIntf methods
429     virtual TemplateVariant get(const char *name) const;
430     virtual int addRef()  { return RefCountedContext::addRef(); }
431     virtual int release() { return RefCountedContext::release(); }
432
433     void addChildren(const BaseClassList *bcl,bool hideSuper);
434
435   private:
436     ClassInheritanceNodeContext(ClassDef *);
437    ~ClassInheritanceNodeContext();
438     class Private;
439     Private *p;
440 };
441
442 //----------------------------------------------------
443
444 class ClassInheritanceContext : public RefCountedContext, public TemplateListIntf
445 {
446   public:
447     static ClassInheritanceContext *alloc() { return new ClassInheritanceContext; }
448
449     // TemplateListIntf
450     virtual int  count() const;
451     virtual TemplateVariant at(int index) const;
452     virtual TemplateListIntf::ConstIterator *createIterator() const;
453     virtual int addRef()  { return RefCountedContext::addRef(); }
454     virtual int release() { return RefCountedContext::release(); }
455
456   private:
457     ClassInheritanceContext();
458    ~ClassInheritanceContext();
459     class Private;
460     Private *p;
461 };
462
463 //----------------------------------------------------
464
465 class ClassHierarchyContext : public RefCountedContext, public TemplateStructIntf
466 {
467   public:
468     static ClassHierarchyContext *alloc() { return new ClassHierarchyContext; }
469
470     // TemplateStructIntf methods
471     virtual TemplateVariant get(const char *name) const;
472     virtual int addRef()  { return RefCountedContext::addRef(); }
473     virtual int release() { return RefCountedContext::release(); }
474
475   private:
476     ClassHierarchyContext();
477    ~ClassHierarchyContext();
478     class Private;
479     Private *p;
480 };
481
482 //----------------------------------------------------
483
484 class NestingNodeContext : public RefCountedContext, public TemplateStructIntf
485 {
486   public:
487     static NestingNodeContext *alloc(const NestingNodeContext *parent,Definition *def,
488                                      int index,int level,bool addClasses)
489     { return new NestingNodeContext(parent,def,index,level,addClasses); }
490
491     QCString id() const;
492
493     // TemplateStructIntf methods
494     virtual TemplateVariant get(const char *name) const;
495     virtual int addRef()  { return RefCountedContext::addRef(); }
496     virtual int release() { return RefCountedContext::release(); }
497
498   private:
499     NestingNodeContext(const NestingNodeContext *parent,
500                        Definition *,int index,int level,bool addClasses);
501    ~NestingNodeContext();
502     class Private;
503     Private *p;
504 };
505
506 //----------------------------------------------------
507
508 class NestingContext : public RefCountedContext, public TemplateListIntf
509 {
510   public:
511     static NestingContext *alloc(const NestingNodeContext *parent,int level)
512     { return new NestingContext(parent,level); }
513
514     // TemplateListIntf
515     virtual int  count() const;
516     virtual TemplateVariant at(int index) const;
517     virtual TemplateListIntf::ConstIterator *createIterator() const;
518     virtual int addRef()  { return RefCountedContext::addRef(); }
519     virtual int release() { return RefCountedContext::release(); }
520
521     void addNamespaces(const NamespaceSDict &nsDict,bool rootOnly,bool addClasses);
522     void addClasses(const ClassSDict &clDict,bool rootOnly);
523     void addDirs(const DirSDict &);
524     void addDirs(const DirList &);
525     void addFiles(const FileNameList &);
526     void addFiles(const FileList &);
527     void addPages(const PageSDict &pages,bool rootOnly);
528     void addModules(const GroupSDict &modules);
529     void addModules(const GroupList &modules);
530
531   private:
532     NestingContext(const NestingNodeContext *parent,int level);
533    ~NestingContext();
534     class Private;
535     Private *p;
536 };
537
538 //----------------------------------------------------
539
540 class ClassTreeContext : public RefCountedContext, public TemplateStructIntf
541 {
542   public:
543     static ClassTreeContext *alloc() { return new ClassTreeContext; }
544
545     // TemplateStructIntf methods
546     virtual TemplateVariant get(const char *name) const;
547     virtual int addRef()  { return RefCountedContext::addRef(); }
548     virtual int release() { return RefCountedContext::release(); }
549
550   private:
551     ClassTreeContext();
552    ~ClassTreeContext();
553     class Private;
554     Private *p;
555 };
556
557 //----------------------------------------------------
558
559 class NamespaceListContext : public RefCountedContext, public TemplateListIntf
560 {
561   public:
562     static NamespaceListContext *alloc() { return new NamespaceListContext; }
563
564     // TemplateListIntf
565     virtual int  count() const;
566     virtual TemplateVariant at(int index) const;
567     virtual TemplateListIntf::ConstIterator *createIterator() const;
568     virtual int addRef()  { return RefCountedContext::addRef(); }
569     virtual int release() { return RefCountedContext::release(); }
570
571   private:
572     NamespaceListContext();
573    ~NamespaceListContext();
574     class Private;
575     Private *p;
576 };
577
578 //----------------------------------------------------
579
580 class NamespaceTreeContext : public RefCountedContext, public TemplateStructIntf
581 {
582   public:
583     static NamespaceTreeContext *alloc() { return new NamespaceTreeContext; }
584
585     // TemplateStructIntf methods
586     virtual TemplateVariant get(const char *name) const;
587     virtual int addRef()  { return RefCountedContext::addRef(); }
588     virtual int release() { return RefCountedContext::release(); }
589
590   private:
591     NamespaceTreeContext();
592    ~NamespaceTreeContext();
593     class Private;
594     Private *p;
595 };
596
597 //----------------------------------------------------
598
599 class DirListContext : public RefCountedContext, public TemplateListIntf
600 {
601   public:
602     static DirListContext *alloc() { return new DirListContext; }
603
604     // TemplateListIntf
605     virtual int  count() const;
606     virtual TemplateVariant at(int index) const;
607     virtual TemplateListIntf::ConstIterator *createIterator() const;
608     virtual int addRef()  { return RefCountedContext::addRef(); }
609     virtual int release() { return RefCountedContext::release(); }
610
611   private:
612     DirListContext();
613    ~DirListContext();
614     class Private;
615     Private *p;
616 };
617
618 //----------------------------------------------------
619
620 class FileListContext : public RefCountedContext, public TemplateListIntf
621 {
622   public:
623     static FileListContext *alloc() { return new FileListContext; }
624
625     // TemplateListIntf
626     virtual int  count() const;
627     virtual TemplateVariant at(int index) const;
628     virtual TemplateListIntf::ConstIterator *createIterator() const;
629     virtual int addRef()  { return RefCountedContext::addRef(); }
630     virtual int release() { return RefCountedContext::release(); }
631
632   private:
633     FileListContext();
634    ~FileListContext();
635     class Private;
636     Private *p;
637 };
638
639 //----------------------------------------------------
640
641 class FileTreeContext : public RefCountedContext, public TemplateStructIntf
642 {
643   public:
644     static FileTreeContext *alloc() { return new FileTreeContext; }
645
646     // TemplateStructIntf methods
647     virtual TemplateVariant get(const char *name) const;
648     virtual int addRef()  { return RefCountedContext::addRef(); }
649     virtual int release() { return RefCountedContext::release(); }
650
651   private:
652     FileTreeContext();
653    ~FileTreeContext();
654     class Private;
655     Private *p;
656 };
657
658 //----------------------------------------------------
659
660 class PageListContext : public RefCountedContext, public TemplateListIntf
661 {
662   public:
663     static PageListContext *alloc(const PageSDict *pages) { return new PageListContext(pages); }
664
665     // TemplateListIntf methods
666     virtual int  count() const;
667     virtual TemplateVariant at(int index) const;
668     virtual TemplateListIntf::ConstIterator *createIterator() const;
669     virtual int addRef()  { return RefCountedContext::addRef(); }
670     virtual int release() { return RefCountedContext::release(); }
671
672     void addPages(const PageSDict &pages);
673
674   private:
675     PageListContext(const PageSDict *pages);
676    ~PageListContext();
677     class Private;
678     Private *p;
679 };
680
681 //----------------------------------------------------
682
683 class PageTreeContext : public RefCountedContext, public TemplateStructIntf
684 {
685   public:
686     static PageTreeContext *alloc() { return new PageTreeContext; }
687
688     // TemplateStructIntf methods
689     virtual TemplateVariant get(const char *name) const;
690     virtual int addRef()  { return RefCountedContext::addRef(); }
691     virtual int release() { return RefCountedContext::release(); }
692
693   private:
694     PageTreeContext();
695    ~PageTreeContext();
696     class Private;
697     Private *p;
698 };
699
700 //----------------------------------------------------
701
702 class ModuleNodeContext : public RefCountedContext, public TemplateStructIntf
703 {
704   public:
705     static ModuleNodeContext *alloc(GroupDef *gd) { return new ModuleNodeContext(gd); }
706
707     // TemplateStructIntf methods
708     virtual TemplateVariant get(const char *name) const;
709     virtual int addRef()  { return RefCountedContext::addRef(); }
710     virtual int release() { return RefCountedContext::release(); }
711
712   private:
713     ModuleNodeContext(GroupDef *);
714    ~ModuleNodeContext();
715     class Private;
716     Private *p;
717 };
718
719 //----------------------------------------------------
720
721 class ModuleListContext : public RefCountedContext, public TemplateListIntf
722 {
723   public:
724     static ModuleListContext *alloc() { return new ModuleListContext(); }
725
726     // TemplateListIntf
727     virtual int  count() const;
728     virtual TemplateVariant at(int index) const;
729     virtual TemplateListIntf::ConstIterator *createIterator() const;
730     virtual int addRef()  { return RefCountedContext::addRef(); }
731     virtual int release() { return RefCountedContext::release(); }
732
733     void addModules(const GroupSDict &);
734     void addModules(const GroupList &);
735
736   private:
737     ModuleListContext();
738    ~ModuleListContext();
739     class Private;
740     Private *p;
741 };
742
743 //----------------------------------------------------
744
745 class ModuleTreeContext : public RefCountedContext, public TemplateStructIntf
746 {
747   public:
748     static ModuleTreeContext *alloc() { return new ModuleTreeContext(); }
749
750     // TemplateStructIntf methods
751     virtual TemplateVariant get(const char *name) const;
752     virtual int addRef()  { return RefCountedContext::addRef(); }
753     virtual int release() { return RefCountedContext::release(); }
754
755   private:
756     ModuleTreeContext();
757    ~ModuleTreeContext();
758     class Private;
759     Private *p;
760 };
761
762 //----------------------------------------------------
763
764 class ExampleListContext : public RefCountedContext, public TemplateStructIntf
765 {
766   public:
767     static ExampleListContext *alloc() { return new ExampleListContext(); }
768
769     // TemplateStructIntf methods
770     virtual TemplateVariant get(const char *name) const;
771     virtual int addRef()  { return RefCountedContext::addRef(); }
772     virtual int release() { return RefCountedContext::release(); }
773
774   private:
775     ExampleListContext();
776    ~ExampleListContext();
777     class Private;
778     Private *p;
779 };
780
781 //----------------------------------------------------
782
783 class GlobalsIndexContext : public RefCountedContext, public TemplateStructIntf
784 {
785   public:
786     static GlobalsIndexContext *alloc() { return new GlobalsIndexContext(); }
787
788     // TemplateStructIntf methods
789     virtual TemplateVariant get(const char *name) const;
790     virtual int addRef()  { return RefCountedContext::addRef(); }
791     virtual int release() { return RefCountedContext::release(); }
792
793   private:
794     GlobalsIndexContext();
795    ~GlobalsIndexContext();
796     class Private;
797     Private *p;
798 };
799
800 //----------------------------------------------------
801
802 class ClassMembersIndexContext : public RefCountedContext, public TemplateStructIntf
803 {
804   public:
805     static ClassMembersIndexContext *alloc() { return new ClassMembersIndexContext(); }
806
807     // TemplateStructIntf methods
808     virtual TemplateVariant get(const char *name) const;
809     virtual int addRef()  { return RefCountedContext::addRef(); }
810     virtual int release() { return RefCountedContext::release(); }
811
812   private:
813     ClassMembersIndexContext();
814    ~ClassMembersIndexContext();
815     class Private;
816     Private *p;
817 };
818
819 //----------------------------------------------------
820
821 class NamespaceMembersIndexContext : public RefCountedContext, public TemplateStructIntf
822 {
823   public:
824     static NamespaceMembersIndexContext *alloc() { return new NamespaceMembersIndexContext(); }
825
826     // TemplateStructIntf methods
827     virtual TemplateVariant get(const char *name) const;
828     virtual int addRef()  { return RefCountedContext::addRef(); }
829     virtual int release() { return RefCountedContext::release(); }
830
831   private:
832     NamespaceMembersIndexContext();
833    ~NamespaceMembersIndexContext();
834     class Private;
835     Private *p;
836 };
837
838 //----------------------------------------------------
839
840 class NavPathElemContext : public RefCountedContext, public TemplateStructIntf
841 {
842   public:
843     static NavPathElemContext *alloc(Definition *def) { return new NavPathElemContext(def); }
844
845     // TemplateStructIntf methods
846     virtual TemplateVariant get(const char *name) const;
847     virtual int addRef()  { return RefCountedContext::addRef(); }
848     virtual int release() { return RefCountedContext::release(); }
849
850   private:
851     NavPathElemContext(Definition *def);
852    ~NavPathElemContext();
853     class Private;
854     Private *p;
855 };
856
857
858 //----------------------------------------------------
859
860 class InheritanceNodeContext : public RefCountedContext, public TemplateStructIntf
861 {
862   public:
863     static InheritanceNodeContext *alloc(ClassDef *cd,const QCString &name)
864     { return new InheritanceNodeContext(cd,name); }
865
866     // TemplateStructIntf methods
867     virtual TemplateVariant get(const char *name) const;
868     virtual int addRef()  { return RefCountedContext::addRef(); }
869     virtual int release() { return RefCountedContext::release(); }
870
871   private:
872     InheritanceNodeContext(ClassDef *cd,const QCString &name);
873    ~InheritanceNodeContext();
874     class Private;
875     Private *p;
876 };
877
878 //----------------------------------------------------
879
880 class InheritanceListContext : public RefCountedContext, public TemplateListIntf
881 {
882   public:
883     static InheritanceListContext *alloc(const BaseClassList *list,bool baseClasses)
884     { return new InheritanceListContext(list,baseClasses); }
885
886     // TemplateListIntf
887     virtual int  count() const;
888     virtual TemplateVariant at(int index) const;
889     virtual TemplateListIntf::ConstIterator *createIterator() const;
890     virtual int addRef()  { return RefCountedContext::addRef(); }
891     virtual int release() { return RefCountedContext::release(); }
892
893   private:
894     InheritanceListContext(const BaseClassList *list,bool baseClasses);
895    ~InheritanceListContext();
896     class Private;
897     Private *p;
898 };
899
900 //----------------------------------------------------
901
902 class MemberListContext : public RefCountedContext, public TemplateListIntf
903 {
904   public:
905     static MemberListContext *alloc()
906     { return new MemberListContext; }
907     static MemberListContext *alloc(const MemberList *ml)
908     { return new MemberListContext(ml); }
909     static MemberListContext *alloc(MemberSDict *ml,bool doSort)
910     { return new MemberListContext(ml,doSort); }
911
912     // TemplateListIntf
913     virtual int  count() const;
914     virtual TemplateVariant at(int index) const;
915     virtual TemplateListIntf::ConstIterator *createIterator() const;
916     virtual int addRef()  { return RefCountedContext::addRef(); }
917     virtual int release() { return RefCountedContext::release(); }
918
919   private:
920     MemberListContext();
921     MemberListContext(const MemberList *ml);
922     MemberListContext(MemberSDict *ml,bool doSort);
923    ~MemberListContext();
924     class Private;
925     Private *p;
926 };
927
928 //----------------------------------------------------
929
930 class MemberGroupInfoContext : public RefCountedContext, public TemplateStructIntf
931 {
932   public:
933     static MemberGroupInfoContext *alloc(Definition *def,const QCString &relPath,const MemberGroup *mg)
934     { return new MemberGroupInfoContext(def,relPath,mg); }
935
936     // TemplateStructIntf methods
937     virtual TemplateVariant get(const char *name) const;
938     virtual int addRef()  { return RefCountedContext::addRef(); }
939     virtual int release() { return RefCountedContext::release(); }
940
941   private:
942     MemberGroupInfoContext(Definition *def,const QCString &relPath,const MemberGroup *mg);
943    ~MemberGroupInfoContext();
944     class Private;
945     Private *p;
946 };
947
948 //----------------------------------------------------
949
950 class MemberGroupListContext : public RefCountedContext, public TemplateListIntf
951 {
952   public:
953     static MemberGroupListContext *alloc()
954     { return new MemberGroupListContext; }
955     static MemberGroupListContext *alloc(Definition *def,const QCString &relPath,const MemberGroupList *list)
956     { return new MemberGroupListContext(def,relPath,list); }
957     static MemberGroupListContext *alloc(Definition *def,const QCString &relPath,const MemberGroupSDict *dict,bool subGrouping)
958     { return new MemberGroupListContext(def,relPath,dict,subGrouping); }
959
960     // TemplateListIntf
961     virtual int  count() const;
962     virtual TemplateVariant at(int index) const;
963     virtual TemplateListIntf::ConstIterator *createIterator() const;
964     virtual int addRef()  { return RefCountedContext::addRef(); }
965     virtual int release() { return RefCountedContext::release(); }
966
967   private:
968     MemberGroupListContext();
969     MemberGroupListContext(Definition *def,const QCString &relPath,const MemberGroupList *list);
970     MemberGroupListContext(Definition *def,const QCString &relPath,const MemberGroupSDict *mgDict,bool subGrouping);
971    ~MemberGroupListContext();
972     class Private;
973     Private *p;
974 };
975
976
977 //----------------------------------------------------
978
979 class MemberListInfoContext : public RefCountedContext, public TemplateStructIntf
980 {
981   public:
982     static MemberListInfoContext *alloc(Definition *def,const QCString &relPath,
983                           const MemberList *ml,const QCString &title,
984                           const QCString &subtitle=QCString())
985     { return new MemberListInfoContext(def,relPath,ml,title,subtitle); }
986
987     // TemplateStructIntf methods
988     virtual TemplateVariant get(const char *name) const;
989     virtual int addRef()  { return RefCountedContext::addRef(); }
990     virtual int release() { return RefCountedContext::release(); }
991
992   private:
993     MemberListInfoContext(Definition *def,const QCString &relPath,
994                           const MemberList *ml,const QCString &title,
995                           const QCString &subtitle=QCString());
996    ~MemberListInfoContext();
997     class Private;
998     Private *p;
999 };
1000
1001 //----------------------------------------------------
1002
1003 class MemberInfoContext : public RefCountedContext, public TemplateStructIntf
1004 {
1005   public:
1006     static MemberInfoContext *alloc(const MemberInfo *mi) { return new MemberInfoContext(mi); }
1007
1008     // TemplateStructIntf methods
1009     virtual TemplateVariant get(const char *name) const;
1010     virtual int addRef()  { return RefCountedContext::addRef(); }
1011     virtual int release() { return RefCountedContext::release(); }
1012
1013   private:
1014     MemberInfoContext(const MemberInfo *mi);
1015    ~MemberInfoContext();
1016     class Private;
1017     Private *p;
1018 };
1019
1020 //----------------------------------------------------
1021
1022 class InheritedMemberInfoContext : public RefCountedContext, public TemplateStructIntf
1023 {
1024   public:
1025     static InheritedMemberInfoContext *alloc(ClassDef *cd,MemberList *ml,const QCString &title)
1026     { return new InheritedMemberInfoContext(cd,ml,title); }
1027
1028     // TemplateStructIntf methods
1029     virtual TemplateVariant get(const char *name) const;
1030     virtual int addRef()  { return RefCountedContext::addRef(); }
1031     virtual int release() { return RefCountedContext::release(); }
1032
1033   private:
1034     InheritedMemberInfoContext(ClassDef *cd,MemberList *ml,const QCString &title);
1035    ~InheritedMemberInfoContext();
1036     class Private;
1037     Private *p;
1038 };
1039
1040 //----------------------------------------------------
1041
1042 class InheritedMemberInfoListContext : public RefCountedContext, public TemplateListIntf
1043 {
1044   public:
1045     static InheritedMemberInfoListContext *alloc() { return new InheritedMemberInfoListContext; }
1046     void addMemberList(ClassDef *cd,MemberListType lt,const QCString &title,bool additionalList=TRUE);
1047
1048     // TemplateListIntf
1049     virtual int  count() const;
1050     virtual TemplateVariant at(int index) const;
1051     virtual TemplateListIntf::ConstIterator *createIterator() const;
1052     virtual int addRef()  { return RefCountedContext::addRef(); }
1053     virtual int release() { return RefCountedContext::release(); }
1054
1055   private:
1056     InheritedMemberInfoListContext();
1057    ~InheritedMemberInfoListContext();
1058     class Private;
1059     Private *p;
1060 };
1061
1062 //----------------------------------------------------
1063
1064 class AllMembersListContext : public RefCountedContext, public TemplateListIntf
1065 {
1066   public:
1067     static AllMembersListContext *alloc()
1068     { return new AllMembersListContext; }
1069     static AllMembersListContext *alloc(const MemberNameInfoSDict *ml)
1070     { return new AllMembersListContext(ml); }
1071
1072     // TemplateListIntf
1073     virtual int  count() const;
1074     virtual TemplateVariant at(int index) const;
1075     virtual TemplateListIntf::ConstIterator *createIterator() const;
1076     virtual int addRef()  { return RefCountedContext::addRef(); }
1077     virtual int release() { return RefCountedContext::release(); }
1078
1079   private:
1080     AllMembersListContext();
1081     AllMembersListContext(const MemberNameInfoSDict *ml);
1082    ~AllMembersListContext();
1083     class Private;
1084     Private *p;
1085 };
1086
1087 //----------------------------------------------------
1088
1089 class ArgumentContext : public RefCountedContext, public TemplateStructIntf
1090 {
1091   public:
1092     static ArgumentContext *alloc(const Argument *arg,Definition *def,const QCString &relPath)
1093     { return new ArgumentContext(arg,def,relPath); }
1094
1095     // TemplateStructIntf methods
1096     virtual TemplateVariant get(const char *name) const;
1097     virtual int addRef()  { return RefCountedContext::addRef(); }
1098     virtual int release() { return RefCountedContext::release(); }
1099
1100   private:
1101     ArgumentContext(const Argument *arg,Definition *def,const QCString &relPath);
1102    ~ArgumentContext();
1103     class Private;
1104     Private *p;
1105 };
1106
1107 //----------------------------------------------------
1108
1109 class ArgumentListContext : public RefCountedContext, public TemplateListIntf
1110 {
1111   public:
1112     static ArgumentListContext *alloc() { return new ArgumentListContext; }
1113     static ArgumentListContext *alloc(const ArgumentList *al,Definition *def,const QCString &relPath)
1114     { return new ArgumentListContext(al,def,relPath); }
1115
1116     // TemplateListIntf
1117     virtual int  count() const;
1118     virtual TemplateVariant at(int index) const;
1119     virtual TemplateListIntf::ConstIterator *createIterator() const;
1120     virtual int addRef()  { return RefCountedContext::addRef(); }
1121     virtual int release() { return RefCountedContext::release(); }
1122
1123   private:
1124     ArgumentListContext();
1125     ArgumentListContext(const ArgumentList *al,Definition *def,const QCString &relPath);
1126    ~ArgumentListContext();
1127     class Private;
1128     Private *p;
1129 };
1130
1131 //----------------------------------------------------
1132
1133 void generateOutputViaTemplate();
1134
1135 #endif