Doxygen
Loading...
Searching...
No Matches
IndexList Class Reference

A list of index interfaces. More...

#include <src/indexlist.h>

Public Member Functions

void disable ()
 disable the indices
 
void enable ()
 enable the indices
 
bool isEnabled () const
 returns true iff the indices are enabled
 
template<class T , class... As>
void addIndex (As &&... args)
 Add an index generator to the list, using a syntax similar to std::make_unique<T>()
 
void initialize ()
 
void finalize ()
 
void incContentsDepth ()
 
void decContentsDepth ()
 
void addContentsItem (bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex=FALSE, bool addToNavIndex=FALSE, const Definition *def=nullptr)
 
void addIndexItem (const Definition *context, const MemberDef *md, const QCString &sectionAnchor=QCString(), const QCString &title=QCString())
 
void addIndexFile (const QCString &name)
 
void addImageFile (const QCString &name)
 
void addStyleSheetFile (const QCString &name)
 

Private Types

using IndexPtr = std::unique_ptr<IndexIntf>
 

Private Member Functions

template<class... Ts, class... As>
void foreach (void(IndexIntf::*methodPtr)(Ts...), As &&... args)
 
template<class... Ts, class... As>
void foreach_locked (void(IndexIntf::*methodPtr)(Ts...), As &&... args)
 

Private Attributes

bool m_enabled = true
 
std::mutex m_mutex
 
std::vector< IndexPtrm_indices
 

Detailed Description

A list of index interfaces.

This class itself implements all methods of IndexIntf and just forwards the calls to all items in the list (composite design pattern).

Definition at line 62 of file indexlist.h.

Member Typedef Documentation

◆ IndexPtr

using IndexList::IndexPtr = std::unique_ptr<IndexIntf>
private

Definition at line 64 of file indexlist.h.

Member Function Documentation

◆ addContentsItem()

void IndexList::addContentsItem ( bool isDir,
const QCString & name,
const QCString & ref,
const QCString & file,
const QCString & anchor,
bool separateIndex = FALSE,
bool addToNavIndex = FALSE,
const Definition * def = nullptr )
inline

Definition at line 115 of file indexlist.h.

118 { if (m_enabled) foreach_locked(&IndexIntf::addContentsItem,isDir,name,ref,file,anchor,separateIndex,addToNavIndex,def); }
virtual void addContentsItem(bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def)=0
bool m_enabled
Definition indexlist.h:133
void foreach_locked(void(IndexIntf::*methodPtr)(Ts...), As &&... args)
Definition indexlist.h:76

References IndexIntf::addContentsItem().

Referenced by PageDefImpl::addSectionsToIndex().

◆ addImageFile()

◆ addIndex()

template<class T , class... As>
void IndexList::addIndex ( As &&... args)
inline

Add an index generator to the list, using a syntax similar to std::make_unique<T>()

Definition at line 100 of file indexlist.h.

101 { m_indices.push_back(std::make_unique<T>(std::forward<As>(args)...)); }
std::vector< IndexPtr > m_indices
Definition indexlist.h:135

◆ addIndexFile()

void IndexList::addIndexFile ( const QCString & name)
inline

Definition at line 123 of file indexlist.h.

virtual void addIndexFile(const QCString &name)=0

References IndexIntf::addIndexFile().

Referenced by HtmlGenerator::startFile().

◆ addIndexItem()

void IndexList::addIndexItem ( const Definition * context,
const MemberDef * md,
const QCString & sectionAnchor = QCString(),
const QCString & title = QCString() )
inline

Definition at line 120 of file indexlist.h.

121 { if (m_enabled) foreach_locked(&IndexIntf::addIndexItem,context,md,sectionAnchor,title); }
virtual void addIndexItem(const Definition *context, const MemberDef *md, const QCString &sectionAnchor, const QCString &title)=0

References IndexIntf::addIndexItem().

Referenced by HtmlDocVisitor::operator()().

◆ addStyleSheetFile()

void IndexList::addStyleSheetFile ( const QCString & name)
inline

◆ decContentsDepth()

void IndexList::decContentsDepth ( )
inline

Definition at line 112 of file indexlist.h.

virtual void decContentsDepth()=0

References IndexIntf::decContentsDepth().

Referenced by PageDefImpl::addSectionsToIndex().

◆ disable()

void IndexList::disable ( )
inline

disable the indices

Definition at line 87 of file indexlist.h.

88 { m_enabled = FALSE; }
#define FALSE
Definition qcstring.h:34

References FALSE.

◆ enable()

void IndexList::enable ( )
inline

enable the indices

Definition at line 91 of file indexlist.h.

92 { m_enabled = TRUE; }
#define TRUE
Definition qcstring.h:37

References TRUE.

◆ finalize()

void IndexList::finalize ( )
inline

Definition at line 106 of file indexlist.h.

107 { foreach(&IndexIntf::finalize); }
virtual void finalize()=0

References IndexIntf::finalize().

◆ foreach()

template<class... Ts, class... As>
void IndexList::foreach ( void(IndexIntf::* methodPtr )(Ts...),
As &&... args )
inlineprivate

Definition at line 67 of file indexlist.h.

68 {
69 for (const auto &intf : m_indices)
70 {
71 (intf.get()->*methodPtr)(std::forward<As>(args)...);
72 }
73 }

◆ foreach_locked()

template<class... Ts, class... As>
void IndexList::foreach_locked ( void(IndexIntf::* methodPtr )(Ts...),
As &&... args )
inlineprivate

Definition at line 76 of file indexlist.h.

77 {
78 std::lock_guard<std::mutex> lock(m_mutex);
79 for (const auto &intf : m_indices)
80 {
81 (intf.get()->*methodPtr)(std::forward<As>(args)...);
82 }
83 }
std::mutex m_mutex
Definition indexlist.h:134

◆ incContentsDepth()

void IndexList::incContentsDepth ( )
inline

Definition at line 109 of file indexlist.h.

virtual void incContentsDepth()=0

References IndexIntf::incContentsDepth().

Referenced by PageDefImpl::addSectionsToIndex().

◆ initialize()

void IndexList::initialize ( )
inline

Definition at line 103 of file indexlist.h.

104 { foreach(&IndexIntf::initialize); }
virtual void initialize()=0

References IndexIntf::initialize().

◆ isEnabled()

bool IndexList::isEnabled ( ) const
inline

returns true iff the indices are enabled

Definition at line 95 of file indexlist.h.

96 { return m_enabled; }

Member Data Documentation

◆ m_enabled

bool IndexList::m_enabled = true
private

Definition at line 133 of file indexlist.h.

◆ m_indices

std::vector<IndexPtr> IndexList::m_indices
private

Definition at line 135 of file indexlist.h.

◆ m_mutex

std::mutex IndexList::m_mutex
private

Definition at line 134 of file indexlist.h.


The documentation for this class was generated from the following file: