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

Abstract proxy interface for non-javascript based search indices. More...

#include <src/searchindex.h>

Public Types

enum  Kind { Disabled , Internal , External }
using SearchIndexVariant = std::variant<std::monostate,SearchIndex,SearchIndexExternal>

Public Member Functions

 SearchIndexIntf ()
bool enabled () const
void setCurrentDoc (const Definition *ctx, const QCString &anchor, bool isSourceFile)
void addWord (const QCString &word, bool hiPriority)
void write (const QCString &file)
void setKind (Kind k)
Kind kind () const

Private Attributes

Kind m_kind
SearchIndexVariant m_variant

Detailed Description

Abstract proxy interface for non-javascript based search indices.

It forwards calls to either SearchIndex or SearchIndexExternal depending on the Kind passed during construction.

Definition at line 139 of file searchindex.h.

Member Typedef Documentation

◆ SearchIndexVariant

Definition at line 142 of file searchindex.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Disabled 
Internal 
External 

Definition at line 143 of file searchindex.h.

Constructor & Destructor Documentation

◆ SearchIndexIntf()

SearchIndexIntf::SearchIndexIntf ( )
inline

Definition at line 144 of file searchindex.h.

References Disabled, and m_kind.

Member Function Documentation

◆ addWord()

void SearchIndexIntf::addWord ( const QCString & word,
bool hiPriority )
inline

Definition at line 158 of file searchindex.h.

159 {
160 if (std::holds_alternative<SearchIndex>(m_variant))
161 {
162 std::get<SearchIndex>(m_variant).addWord(word,hiPriority);
163 }
164 else if (std::holds_alternative<SearchIndexExternal>(m_variant))
165 {
166 std::get<SearchIndexExternal>(m_variant).addWord(word,hiPriority);
167 }
168 }
SearchIndexVariant m_variant

References m_variant.

◆ enabled()

bool SearchIndexIntf::enabled ( ) const
inline

Definition at line 145 of file searchindex.h.

145{ return m_kind!=Disabled; }

References Disabled, and m_kind.

◆ kind()

Kind SearchIndexIntf::kind ( ) const
inline

Definition at line 189 of file searchindex.h.

189{ return m_kind; }

References m_kind.

◆ setCurrentDoc()

void SearchIndexIntf::setCurrentDoc ( const Definition * ctx,
const QCString & anchor,
bool isSourceFile )
inline

Definition at line 147 of file searchindex.h.

148 {
149 if (std::holds_alternative<SearchIndex>(m_variant))
150 {
151 std::get<SearchIndex>(m_variant).setCurrentDoc(ctx,anchor,isSourceFile);
152 }
153 else if (std::holds_alternative<SearchIndexExternal>(m_variant))
154 {
155 std::get<SearchIndexExternal>(m_variant).setCurrentDoc(ctx,anchor,isSourceFile);
156 }
157 }

References m_variant.

◆ setKind()

void SearchIndexIntf::setKind ( Kind k)
inline

Definition at line 180 of file searchindex.h.

180 {
181 m_kind=k;
182 switch (m_kind)
183 {
184 case Disabled: m_variant = std::monostate(); break;
185 case Internal: m_variant = SearchIndex(); break;
186 case External: m_variant = SearchIndexExternal(); break;
187 }
188 }

References Disabled, External, Internal, m_kind, and m_variant.

◆ write()

void SearchIndexIntf::write ( const QCString & file)
inline

Definition at line 169 of file searchindex.h.

170 {
171 if (std::holds_alternative<SearchIndex>(m_variant))
172 {
173 std::get<SearchIndex>(m_variant).write(file);
174 }
175 else if (std::holds_alternative<SearchIndexExternal>(m_variant))
176 {
177 std::get<SearchIndexExternal>(m_variant).write(file);
178 }
179 }

References m_variant.

Member Data Documentation

◆ m_kind

Kind SearchIndexIntf::m_kind
private

Definition at line 191 of file searchindex.h.

Referenced by enabled(), kind(), SearchIndexIntf(), and setKind().

◆ m_variant

SearchIndexVariant SearchIndexIntf::m_variant
private

Definition at line 192 of file searchindex.h.

Referenced by addWord(), setCurrentDoc(), setKind(), and write().


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