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