Skip to main content

IndexList Class

A list of index interfaces. More...

Declaration​

class IndexList { ... }

Included Headers​

#include <src/indexlist.h>

Private Member Typedefs Index​

usingIndexPtr = std::unique_ptr< IndexIntf >

Public Member Functions Index​

voiddisable ()

disable the indices More...

voidenable ()

enable the indices More...

boolisEnabled () const

returns true iff the indices are enabled More...

template <class T, class... As>
voidaddIndex (As &&... args)

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

voidinitialize ()
voidfinalize ()
voidincContentsDepth ()
voiddecContentsDepth ()
voidaddContentsItem (bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex=FALSE, bool addToNavIndex=FALSE, const Definition *def=nullptr, const QCString &nameAsHtml=QCString())
voidaddIndexItem (const Definition *context, const MemberDef *md, const QCString &sectionAnchor=QCString(), const QCString &title=QCString())
voidaddIndexFile (const QCString &name)
voidaddImageFile (const QCString &name)
voidaddStyleSheetFile (const QCString &name)

Private Member Functions Index​

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

Private Member Attributes Index​

boolm_enabled = true
std::mutexm_mutex
std::vector< IndexPtr >m_indices

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 63 of file indexlist.h.

Private Member Typedefs​

IndexPtr​

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

Definition at line 65 of file indexlist.h.

65 using IndexPtr = std::unique_ptr<IndexIntf>;

Public Member Functions​

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, const QCString & nameAsHtml=QCString())
inline

Definition at line 116 of file indexlist.h.

116 void addContentsItem(bool isDir, const QCString &name, const QCString &ref,
117 const QCString &file, const QCString &anchor,bool separateIndex=FALSE,bool addToNavIndex=FALSE,
118 const Definition *def=nullptr, const QCString &nameAsHtml = QCString())
119 { if (m_enabled) foreach_locked(&IndexIntf::addContentsItem,isDir,name,ref,file,anchor,separateIndex,addToNavIndex,def,nameAsHtml); }

References IndexIntf::addContentsItem, FALSE, foreach_locked and m_enabled.

addImageFile()​

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

Definition at line 127 of file indexlist.h.

127 void addImageFile(const QCString &name)

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 101 of file indexlist.h.

101 void addIndex(As&&... args)
102 { m_indices.push_back(std::make_unique<T>(std::forward<As>(args)...)); }

Reference m_indices.

addIndexFile()​

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

Definition at line 124 of file indexlist.h.

124 void addIndexFile(const QCString &name)

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 121 of file indexlist.h.

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

References IndexIntf::addIndexItem, foreach_locked and m_enabled.

addStyleSheetFile()​

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

Definition at line 130 of file indexlist.h.

References IndexIntf::addStyleSheetFile, foreach_locked and m_enabled.

decContentsDepth()​

void IndexList::decContentsDepth ()
inline

disable()​

void IndexList::disable ()
inline

disable the indices

Definition at line 88 of file indexlist.h.

88 void disable()
89 { m_enabled = FALSE; }

References FALSE and m_enabled.

enable()​

void IndexList::enable ()
inline

enable the indices

Definition at line 92 of file indexlist.h.

92 void enable()
93 { m_enabled = TRUE; }

References m_enabled and TRUE.

finalize()​

void IndexList::finalize ()
inline

Definition at line 107 of file indexlist.h.

107 void finalize()
108 { foreach(&IndexIntf::finalize); }

Reference IndexIntf::finalize.

incContentsDepth()​

void IndexList::incContentsDepth ()
inline

initialize()​

void IndexList::initialize ()
inline

Definition at line 104 of file indexlist.h.

105 { foreach(&IndexIntf::initialize); }

Reference IndexIntf::initialize.

isEnabled()​

bool IndexList::isEnabled ()
inline

returns true iff the indices are enabled

Definition at line 96 of file indexlist.h.

96 bool isEnabled() const
97 { return m_enabled; }

Reference m_enabled.

Private Member Functions​

foreach()​

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

Definition at line 68 of file indexlist.h.

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

foreach_locked()​

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

Definition at line 77 of file indexlist.h.

77 void foreach_locked(void (IndexIntf::*methodPtr)(Ts...),As&&... args)
78 {
79 std::lock_guard<std::mutex> lock(m_mutex);
80 for (const auto &intf : m_indices)
81 {
82 (intf.get()->*methodPtr)(std::forward<As>(args)...);
83 }
84 }

References m_indices and m_mutex.

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

Private Member Attributes​

m_enabled​

bool IndexList::m_enabled = true

m_indices​

std::vector<IndexPtr> IndexList::m_indices

Definition at line 136 of file indexlist.h.

136 std::vector<IndexPtr> m_indices;

Referenced by addIndex and foreach_locked.

m_mutex​

std::mutex IndexList::m_mutex

Definition at line 135 of file indexlist.h.

135 std::mutex m_mutex;

Referenced by foreach_locked.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.14.0.