compoundhandler.cpp 17.8 KB
Newer Older
Dimitri van Heesch's avatar
Dimitri van Heesch committed
1 2 3 4 5
/******************************************************************************
 *
 * $Id$
 *
 *
Dimitri van Heesch's avatar
Dimitri van Heesch committed
6
 * Copyright (C) 1997-2014 by Dimitri van Heesch.
Dimitri van Heesch's avatar
Dimitri van Heesch committed
7 8 9 10 11 12 13 14 15
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation under the terms of the GNU General Public License is hereby 
 * granted. No representations are made about the suitability of this software 
 * for any purpose. It is provided "as is" without express or implied warranty.
 * See the GNU General Public License for more details.
 *
 */

Dimitri van Heesch's avatar
Dimitri van Heesch committed
16 17 18
#include "mainhandler.h"
#include "compoundhandler.h"
#include "dochandler.h"
19
#include "debug.h"
20 21
#include "graphhandler.h"
#include "sectionhandler.h"
22
#include "paramhandler.h"
23
#include "loamhandler.h"
24
#include "memberhandler.h"
Dimitri van Heesch's avatar
Dimitri van Heesch committed
25

Dimitri van Heesch's avatar
Dimitri van Heesch committed
26 27
//----------------------------------------------------------------------------

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
IncludeHandler::IncludeHandler(IBaseHandler *parent,const char *endtag) :
  m_parent(parent)
{
  addEndHandler(endtag,this,&IncludeHandler::endInclude);
}

IncludeHandler::~IncludeHandler()
{
}

void IncludeHandler::startInclude(const QXmlAttributes &attrib)
{
  m_curString = "";
  m_refId     = attrib.value("refid");
  m_isLocal   = attrib.value("local")=="yes";
  m_parent->setDelegate(this);
}

void IncludeHandler::endInclude()
{
  m_name = m_curString;
  m_parent->setDelegate(0);
  debug(2,"Found include %s\n",m_name.data());
}

//----------------------------------------------------------------------------

Dimitri van Heesch's avatar
Dimitri van Heesch committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
class CompoundIdIterator : public ICompoundIterator,
                           public QListIterator<QString>
{
  public:
    CompoundIdIterator(const MainHandler *m,const QList<QString> &list) :
      QListIterator<QString>(list), m_mainHandler(m) {}
    virtual ~CompoundIdIterator() {}

    virtual void toFirst()
    { 
      QListIterator<QString>::toFirst(); 
    }
    virtual void toLast()
    { 
      QListIterator<QString>::toLast(); 
    }
    virtual void toNext()
    { 
      QListIterator<QString>::operator++(); 
    }
    virtual void toPrev()
    { 
      QListIterator<QString>::operator--(); 
    }
    virtual ICompound *current() const
    { 
      QString *id = QListIterator<QString>::current(); 
Dimitri van Heesch's avatar
Dimitri van Heesch committed
82
      return id ? m_mainHandler->compoundById(id->utf8()) : 0;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
83 84 85 86 87 88 89 90 91 92 93 94
    }
    virtual void release()
    { delete this; }

  private:
    const MainHandler *m_mainHandler;
};

//----------------------------------------------------------------------------

ICompound *RelatedCompound::compound() const 
{ 
Dimitri van Heesch's avatar
Dimitri van Heesch committed
95
  return m_parent->m_mainHandler->compoundById(m_id.utf8()); 
Dimitri van Heesch's avatar
Dimitri van Heesch committed
96 97 98 99
}

//----------------------------------------------------------------------------

100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
class CompoundErrorHandler : public QXmlErrorHandler
{
    public:
      virtual ~CompoundErrorHandler() {}
      bool warning( const QXmlParseException & )
      {
        return FALSE;
      }
      bool error( const QXmlParseException & )
      {
        return FALSE;
      }
      bool fatalError( const QXmlParseException &exception )
      {
        debug(1,"Fatal error at line %d column %d: %s\n",
            exception.lineNumber(),exception.columnNumber(),
            exception.message().data());
        return FALSE;
      }
      QString errorString() { return ""; }

    private:
      QString errorMsg;
};

//----------------------------------------------------------------------------

class CompoundTypeMap
{
  public:
    CompoundTypeMap()
    {
      m_map.setAutoDelete(TRUE);
133 134 135
      m_map.insert("class",    new int(ICompound::Class));
      m_map.insert("struct",   new int(ICompound::Struct));
      m_map.insert("union",    new int(ICompound::Union));
136
      m_map.insert("interface",new int(ICompound::Interface));
137 138
      m_map.insert("protocol", new int(ICompound::Protocol));
      m_map.insert("category", new int(ICompound::Category));
139
      m_map.insert("exception",new int(ICompound::Exception));
140
      m_map.insert("file",     new int(ICompound::File));
141
      m_map.insert("namespace",new int(ICompound::Namespace));
142 143 144 145
      m_map.insert("group",    new int(ICompound::Group));
      m_map.insert("page",     new int(ICompound::Page));
      m_map.insert("example",  new int(ICompound::Example));
      m_map.insert("dir",      new int(ICompound::Dir));
146 147 148 149 150 151
    }
    virtual ~CompoundTypeMap()
    {
    }
    ICompound::CompoundKind map(const QString &s)
    {
Dimitri van Heesch's avatar
Dimitri van Heesch committed
152
      int *val = m_map.find(s.utf8());
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
      if (val==0) 
      {
        debug(1,"Warning: `%s' is an invalid compound type\n",s.data());
        return ICompound::Invalid;
      }
      else return (ICompound::CompoundKind)*val;
    }
  private: 
    QDict<int> m_map;
};

static CompoundTypeMap *s_typeMap;

void compoundhandler_init()
{
  s_typeMap = new CompoundTypeMap;
}

void compoundhandler_exit()
{
  delete s_typeMap;
}

//----------------------------------------------------------------------------

CompoundHandler::CompoundHandler(const QString &xmlDir) 
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
  : m_titleHandler(0), 
    m_includeDependencyGraph(0), 
    m_includedByDependencyGraph(0), 
    m_templateParamList(0),
    m_brief(0), 
    m_detailed(0), 
    m_inheritanceGraph(0), 
    m_collaborationGraph(0),
    m_programListing(0),
    m_members(0),
    m_xmlDir(xmlDir), 
    m_refCount(1), 
    m_memberDict(257), 
    m_memberNameDict(257),
    m_mainHandler(0)
Dimitri van Heesch's avatar
Dimitri van Heesch committed
194 195
{
  m_superClasses.setAutoDelete(TRUE);
196 197
  m_subClasses.setAutoDelete(TRUE);
  m_sections.setAutoDelete(TRUE);
198
  m_memberNameDict.setAutoDelete(TRUE);
199
  m_innerCompounds.setAutoDelete(TRUE);
200 201
  m_includes.setAutoDelete(TRUE);
  m_includedBy.setAutoDelete(TRUE);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
202

203 204 205 206
  addStartHandler("doxygen");
  addEndHandler("doxygen");
  
  addStartHandler("compounddef",this,&CompoundHandler::startCompound);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
207 208 209 210 211
  addEndHandler("compounddef",this,&CompoundHandler::endCompound);

  addStartHandler("compoundname");
  addEndHandler("compoundname",this,&CompoundHandler::endCompoundName);

212
  addStartHandler("title",this,&CompoundHandler::startTitle);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
213

214 215
  addStartHandler("basecompoundref",this,&CompoundHandler::startSuperClass);
  addEndHandler("basecompoundref",this,&CompoundHandler::endSuperClass);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
216

217 218
  addStartHandler("derivedcompoundref",this,&CompoundHandler::startSubClass);
  addEndHandler("derivedcompoundref",this,&CompoundHandler::endSubClass);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
219

220 221 222
  addStartHandler("includes",this,&CompoundHandler::startIncludes);
  addStartHandler("includedby",this,&CompoundHandler::startIncludedBy);

223 224 225 226
  addStartHandler("incdepgraph",this,&CompoundHandler::startIncludeDependencyGraph);

  addStartHandler("invincdepgraph",this,&CompoundHandler::startIncludedByDependencyGraph);

227 228 229
  addStartHandler("innerdir",this,&CompoundHandler::startInnerDir);
  addEndHandler("innerdir");

230 231 232
  addStartHandler("innerfile",this,&CompoundHandler::startInnerFile);
  addEndHandler("innerfile");

Dimitri van Heesch's avatar
Dimitri van Heesch committed
233 234 235
  addStartHandler("innerclass",this,&CompoundHandler::startInnerClass);
  addEndHandler("innerclass");

236 237 238
  addStartHandler("innernamespace",this,&CompoundHandler::startInnerNamespace);
  addEndHandler("innernamespace");

239 240
  addStartHandler("innerpage",this,&CompoundHandler::startInnerPage);
  addEndHandler("innerpage");
241
  
242 243 244
  addStartHandler("innergroup",this,&CompoundHandler::startInnerGroup);
  addEndHandler("innergroup");

245 246
  addStartHandler("templateparamlist",this,&CompoundHandler::startTemplateParamList);

247 248 249 250 251 252 253 254 255 256 257 258 259 260
  addStartHandler("sectiondef",this,&CompoundHandler::startSection);

  addStartHandler("briefdescription",this,&CompoundHandler::startBriefDesc);

  addStartHandler("detaileddescription",this,&CompoundHandler::startDetailedDesc);
  
  addStartHandler("inheritancegraph",this,&CompoundHandler::startInheritanceGraph);
  
  addStartHandler("collaborationgraph",this,&CompoundHandler::startCollaborationGraph);

  addStartHandler("programlisting",this,&CompoundHandler::startProgramListing);

  addStartHandler("location",this,&CompoundHandler::startLocation);
  addEndHandler("location");
261 262

  addStartHandler("listofallmembers",this,&CompoundHandler::startListOfAllMembers);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
263 264 265 266
}

CompoundHandler::~CompoundHandler()
{
267
  debug(2,"CompoundHandler::~CompoundHandler()\n");
268
  delete m_titleHandler;
269 270
  delete m_brief;
  delete m_detailed;
271
  delete m_programListing;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
272 273
  delete m_inheritanceGraph;
  delete m_collaborationGraph;
274 275
  delete m_includeDependencyGraph;
  delete m_includedByDependencyGraph;
276 277
  delete m_templateParamList;
  delete m_members;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
}

void CompoundHandler::startSection(const QXmlAttributes& attrib)
{
  SectionHandler *sectHandler = new SectionHandler(this);
  sectHandler->startSection(attrib);
  m_sections.append(sectHandler);
}

void CompoundHandler::startBriefDesc(const QXmlAttributes& attrib)
{
  DocHandler *docHandler = new DocHandler(this);
  docHandler->startDoc(attrib);
  m_brief = docHandler;
}

void CompoundHandler::startDetailedDesc(const QXmlAttributes& attrib)
{
  DocHandler *docHandler = new DocHandler(this);
  docHandler->startDoc(attrib);
  m_detailed = docHandler;
}

301 302 303 304 305 306 307
void CompoundHandler::startProgramListing(const QXmlAttributes& attrib)
{
  ProgramListingHandler *plHandler = new ProgramListingHandler(this);
  plHandler->startProgramListing(attrib);
  m_programListing = plHandler;
}

308 309 310 311 312 313 314 315 316 317 318 319 320 321
void CompoundHandler::startIncludes(const QXmlAttributes& attrib)
{
  IncludeHandler *inc = new IncludeHandler(this,"includes");
  m_includes.append(inc);
  inc->startInclude(attrib);
}

void CompoundHandler::startIncludedBy(const QXmlAttributes& attrib)
{
  IncludeHandler *inc = new IncludeHandler(this,"includedby");
  m_includedBy.append(inc);
  inc->startInclude(attrib);
}

Dimitri van Heesch's avatar
Dimitri van Heesch committed
322 323
void CompoundHandler::startCompound(const QXmlAttributes& attrib)
{
324
  m_id         = attrib.value("id");
325
  m_kindString = attrib.value("kind");
326
  m_kind       = s_typeMap->map(m_kindString);
327
  m_protection = attrib.value("prot");
328
  debug(2,"startCompound(id=`%s' type=`%s')\n",m_id.data(),m_kindString.data());
329 330
}

331
void CompoundHandler::endCompound()
332
{
333
   debug(2,"endCompound()\n");
Dimitri van Heesch's avatar
Dimitri van Heesch committed
334 335
}

336
void CompoundHandler::startLocation(const QXmlAttributes& attrib)
Dimitri van Heesch's avatar
Dimitri van Heesch committed
337
{
338 339 340
  m_defFile      = attrib.value("file");
  m_defLine      = attrib.value("line").toInt();
  m_defBodyFile  = attrib.value("bodyfile");
341
  m_defBodyStart = attrib.value("bodystart").toInt();
342
  m_defBodyEnd   = attrib.value("bodyend").toInt();
Dimitri van Heesch's avatar
Dimitri van Heesch committed
343 344 345 346 347
}

void CompoundHandler::endCompoundName()
{
  m_name = m_curString.stripWhiteSpace();
348
  debug(2,"Compound name `%s'\n",m_name.data());
Dimitri van Heesch's avatar
Dimitri van Heesch committed
349 350
}

Dimitri van Heesch's avatar
Dimitri van Heesch committed
351 352
void CompoundHandler::startInnerClass(const QXmlAttributes& attrib)
{
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
  m_innerCompounds.append(new QString(attrib.value("refid")));
}

void CompoundHandler::startInnerNamespace(const QXmlAttributes& attrib)
{
  m_innerCompounds.append(new QString(attrib.value("refid")));
}

void CompoundHandler::startInnerFile(const QXmlAttributes& attrib)
{
  m_innerCompounds.append(new QString(attrib.value("refid")));
}

void CompoundHandler::startInnerGroup(const QXmlAttributes& attrib)
{
  m_innerCompounds.append(new QString(attrib.value("refid")));
}

371 372 373 374 375 376 377 378 379 380
void CompoundHandler::startInnerPage(const QXmlAttributes& attrib)
{
  m_innerCompounds.append(new QString(attrib.value("refid")));
}

void CompoundHandler::startInnerDir(const QXmlAttributes& attrib)
{
  m_innerCompounds.append(new QString(attrib.value("refid")));
}

381
void CompoundHandler::startTemplateParamList(const QXmlAttributes& attrib)
382
{
383 384
  m_templateParamList = new TemplateParamListHandler(this);
  m_templateParamList->startTemplateParamList(attrib);
385 386
}

387
void CompoundHandler::startListOfAllMembers(const QXmlAttributes& attrib)
388
{
389 390
  m_members = new ListOfAllMembersHandler(this);
  m_members->startListOfAllMembers(attrib);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
391 392
}

393
void CompoundHandler::startSuperClass(const QXmlAttributes& attrib)
Dimitri van Heesch's avatar
Dimitri van Heesch committed
394
{
Dimitri van Heesch's avatar
Dimitri van Heesch committed
395 396
  IRelatedCompound::Protection prot = IRelatedCompound::Public;
  QString protString = attrib.value("prot");
397 398 399 400 401 402 403 404
  if (protString=="protected") 
  {
    prot = IRelatedCompound::Protected;
  }
  else if (protString=="private") 
  {
    prot = IRelatedCompound::Private;
  }
Dimitri van Heesch's avatar
Dimitri van Heesch committed
405 406 407 408 409 410
  IRelatedCompound::Kind kind = IRelatedCompound::Normal;
  QString kindString = attrib.value("virt");
  if (kindString=="virtual") kind = IRelatedCompound::Virtual;
  
  RelatedCompound *sc=new RelatedCompound(
          this,
Dimitri van Heesch's avatar
Dimitri van Heesch committed
411
          attrib.value("refid"),
Dimitri van Heesch's avatar
Dimitri van Heesch committed
412 413
          prot,
          kind
Dimitri van Heesch's avatar
Dimitri van Heesch committed
414
         );
415
  debug(2,"super class id=`%s' prot=`%s' virt=`%s'\n",
Dimitri van Heesch's avatar
Dimitri van Heesch committed
416 417 418
      attrib.value("refid").data(),
      protString.data(),
      kindString.data());
Dimitri van Heesch's avatar
Dimitri van Heesch committed
419
  m_superClasses.append(sc);
420 421 422 423 424 425
  m_curString = "";
}

void CompoundHandler::endSuperClass()
{
  m_superClasses.getLast()->setName(m_curString);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
426 427
}

428
void CompoundHandler::startSubClass(const QXmlAttributes& attrib)
Dimitri van Heesch's avatar
Dimitri van Heesch committed
429
{
Dimitri van Heesch's avatar
Dimitri van Heesch committed
430 431 432 433 434 435 436 437 438 439 440
  IRelatedCompound::Protection prot = IRelatedCompound::Public;
  QString protString = attrib.value("prot");
  if (protString=="protected") prot = IRelatedCompound::Protected;
  else if (protString=="private") prot = IRelatedCompound::Private;

  IRelatedCompound::Kind kind = IRelatedCompound::Normal;
  QString kindString = attrib.value("virt");
  if (kindString=="virtual") kind = IRelatedCompound::Virtual;
  
  RelatedCompound *sc = new RelatedCompound(
          this,
Dimitri van Heesch's avatar
Dimitri van Heesch committed
441
          attrib.value("refid"),
Dimitri van Heesch's avatar
Dimitri van Heesch committed
442 443
          prot,
          kind
Dimitri van Heesch's avatar
Dimitri van Heesch committed
444
         );
445
  debug(2,"sub class id=`%s' prot=`%s' virt=`%s'\n",
Dimitri van Heesch's avatar
Dimitri van Heesch committed
446 447 448
      attrib.value("refid").data(),
      protString.data(),
      kindString.data());
Dimitri van Heesch's avatar
Dimitri van Heesch committed
449
  m_subClasses.append(sc);
450 451 452 453 454 455
  m_curString = "";
}

void CompoundHandler::endSubClass()
{
  m_subClasses.getLast()->setName(m_curString);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
456 457
}

458 459 460 461 462 463 464
void CompoundHandler::startTitle(const QXmlAttributes& attrib)
{
  ASSERT(m_titleHandler==0);
  m_titleHandler = new TitleHandler(this);
  m_titleHandler->startTitle(attrib);
}

465
bool CompoundHandler::parseXML(const char *compId)
466 467 468 469 470 471 472 473 474 475 476 477 478
{
  QFile xmlFile(m_xmlDir+"/"+compId+".xml");
  if (!xmlFile.exists()) return FALSE;
  CompoundErrorHandler errorHandler;
  QXmlInputSource source( xmlFile );
  QXmlSimpleReader reader;
  reader.setContentHandler( this );
  reader.setErrorHandler( &errorHandler );
  reader.parse( source );
  return TRUE;
}

void CompoundHandler::initialize(MainHandler *mh)
Dimitri van Heesch's avatar
Dimitri van Heesch committed
479
{
480
  m_mainHandler = mh;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
481
  QListIterator<SectionHandler> msi(m_sections);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
482
  SectionHandler *sec;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
483
  for (;(sec=msi.current());++msi)
Dimitri van Heesch's avatar
Dimitri van Heesch committed
484
  {
485 486
    sec->initialize(this);
  }
487 488 489 490
  if (m_members)
  {
    m_members->initialize(mh);
  }
491 492 493 494
}

void CompoundHandler::insertMember(MemberHandler *mh)
{
495
  m_memberDict.insert(mh->id()->latin1(),mh);
496
  mh->initialize(m_mainHandler);
497
  QList<MemberHandler> *mhl = m_memberNameDict.find(mh->id()->latin1());
498 499 500
  if (mhl==0)
  {
    mhl = new QList<MemberHandler>;
501
    m_memberNameDict.insert(mh->name()->latin1(),mhl);
502 503 504 505
  }
  mhl->append(mh);
}

Dimitri van Heesch's avatar
Dimitri van Heesch committed
506 507 508 509
ICompound *CompoundHandler::toICompound() const
{
  switch (m_kind)
  {
510 511 512 513 514 515 516 517 518 519 520 521 522
    case ICompound::Class:     return (IClass *)this;
    case ICompound::Struct:    return (IStruct *)this;
    case ICompound::Union:     return (IUnion *)this;
    case ICompound::Interface: return (IInterface *)this;
    case ICompound::Protocol:  return (IClass *)this;
    case ICompound::Category:  return (IClass *)this;
    case ICompound::Exception: return (IException *)this;
    case ICompound::File:      return (IFile *)this;
    case ICompound::Namespace: return (INamespace *)this;
    case ICompound::Group:     return (IGroup *)this;
    case ICompound::Page:      return (IPage *)this;
    case ICompound::Example:   return (IPage *)this;
    case ICompound::Dir:       return (IDir *)this;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
523 524 525 526 527
    default:   return 0;
  }
  return 0;
}

528 529 530 531 532 533 534
void CompoundHandler::release()
{ 
  debug(2,"CompoundHandler::release() %d->%d\n",m_refCount,m_refCount-1);
  if (--m_refCount<=0)
  {
    m_mainHandler->unloadCompound(this);
    delete this; 
Dimitri van Heesch's avatar
Dimitri van Heesch committed
535 536 537
  }
}

538 539 540 541 542
ISectionIterator *CompoundHandler::sections() const 
{ 
  return new SectionIterator(m_sections); 
}
    
543
IMemberIterator *CompoundHandler::memberByName(const char *name) const
544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
{ 
  QList<MemberHandler> *ml = m_memberNameDict[name]; 
  if (ml==0) return 0;
  return new MemberIterator(*ml);
}

void CompoundHandler::startInheritanceGraph(const QXmlAttributes &attrib)
{
  m_inheritanceGraph = new GraphHandler(this,"inheritancegraph");
  m_inheritanceGraph->startGraph(attrib);
}

void CompoundHandler::startCollaborationGraph(const QXmlAttributes &attrib)
{
  m_collaborationGraph = new GraphHandler(this,"collaborationgraph");
  m_collaborationGraph->startGraph(attrib);
}

562 563 564 565 566 567 568 569 570 571 572 573
void CompoundHandler::startIncludeDependencyGraph(const QXmlAttributes &attrib)
{
  m_includeDependencyGraph = new GraphHandler(this,"incdepgraph");
  m_includeDependencyGraph->startGraph(attrib);
}

void CompoundHandler::startIncludedByDependencyGraph(const QXmlAttributes &attrib)
{
  m_includedByDependencyGraph = new GraphHandler(this,"invincdepgraph");
  m_includedByDependencyGraph->startGraph(attrib);
}

574 575 576 577 578 579 580 581 582 583
IDocRoot *CompoundHandler::briefDescription() const 
{ 
  return m_brief; 
}

IDocRoot *CompoundHandler::detailedDescription() const 
{ 
  return m_detailed; 
}

584
IMember *CompoundHandler::memberById(const char *id) const 
585
{ 
586
  return (IFunction*)m_memberDict[id]; 
587 588
}

589 590 591 592 593 594 595 596 597 598
IGraph *CompoundHandler::inheritanceGraph() const 
{ 
  return m_inheritanceGraph; 
}

IGraph *CompoundHandler::collaborationGraph() const 
{ 
  return m_collaborationGraph; 
}

599 600 601 602 603 604 605 606 607 608
IGraph *CompoundHandler::includeDependencyGraph() const
{
  return m_includeDependencyGraph;
}

IGraph *CompoundHandler::includedByDependencyGraph() const
{
  return m_includedByDependencyGraph;
}

609
IRelatedCompoundIterator *CompoundHandler::baseCompounds() const
Dimitri van Heesch's avatar
Dimitri van Heesch committed
610 611 612 613
{
  return new RelatedCompoundIterator(m_superClasses);
}

614
IRelatedCompoundIterator *CompoundHandler::derivedCompounds() const
Dimitri van Heesch's avatar
Dimitri van Heesch committed
615 616 617 618
{
  return new RelatedCompoundIterator(m_subClasses);
}

619
ICompoundIterator *CompoundHandler::nestedCompounds() const
Dimitri van Heesch's avatar
Dimitri van Heesch committed
620
{
621
  return new CompoundIdIterator(m_mainHandler,m_innerCompounds);
Dimitri van Heesch's avatar
Dimitri van Heesch committed
622 623
}

624 625 626 627 628
IDocProgramListing *CompoundHandler::source() const
{
  return m_programListing;
}

629 630 631 632 633 634 635 636 637 638
IIncludeIterator *CompoundHandler::includes() const
{
  return new IncludeIterator(m_includes);
}

IIncludeIterator *CompoundHandler::includedBy() const
{
  return new IncludeIterator(m_includedBy);
}

639 640
IParamIterator *CompoundHandler::templateParameters() const
{
641
  return m_templateParamList ? m_templateParamList->templateParams() : 0;
642 643
}

644 645 646 647
const IDocTitle *CompoundHandler::title() const
{
  return m_titleHandler;
}
648 649 650 651 652 653 654

IMemberReferenceIterator *CompoundHandler::members() const
{
  return m_members ? m_members->members() : 0;
}