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(), FALSE, foreach_locked(), and m_enabled.

◆ addImageFile()

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

Definition at line 126 of file indexlist.h.

virtual void addImageFile(const QCString &)=0

References IndexIntf::addImageFile(), foreach_locked(), and m_enabled.

◆ 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

References m_indices.

◆ 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(), foreach_locked(), and m_enabled.

◆ 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(), foreach_locked(), and m_enabled.

◆ addStyleSheetFile()

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

Definition at line 129 of file indexlist.h.

virtual void addStyleSheetFile(const QCString &)=0

References IndexIntf::addStyleSheetFile(), foreach_locked(), and m_enabled.

◆ decContentsDepth()

void IndexList::decContentsDepth ( )
inline

Definition at line 112 of file indexlist.h.

virtual void decContentsDepth()=0

References IndexIntf::decContentsDepth(), foreach_locked(), and m_enabled.

◆ 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, and m_enabled.

◆ 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 m_enabled, and 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

References m_indices, and m_mutex.

Referenced by addContentsItem(), addImageFile(), addIndexFile(), addIndexItem(), addStyleSheetFile(), decContentsDepth(), and incContentsDepth().

◆ incContentsDepth()

void IndexList::incContentsDepth ( )
inline

Definition at line 109 of file indexlist.h.

virtual void incContentsDepth()=0

References foreach_locked(), IndexIntf::incContentsDepth(), and m_enabled.

◆ 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; }

References m_enabled.

Member Data Documentation

◆ m_enabled

bool IndexList::m_enabled = true
private

◆ m_indices

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

Definition at line 135 of file indexlist.h.

Referenced by addIndex(), and foreach_locked().

◆ m_mutex

std::mutex IndexList::m_mutex
private

Definition at line 134 of file indexlist.h.

Referenced by foreach_locked().


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