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

Class representing a list of different code generators. More...

#include <src/outputlist.h>

Classes

struct  OutputCodeElem
 

Public Types

using OutputCodeIntfPtr = std::unique_ptr<OutputCodeIntf>
 

Public Member Functions

int id () const
 
void setId (int id)
 
void add (OutputCodeIntfPtr &&p)
 
template<class T, class... As>
T * add (As &&... args)
 Add a code generator to the list, using a syntax similar to std::make_unique<T>()
 
template<class T>
T * get (OutputType o)
 Returns a pointer to a specific generator in the list.
 
void setEnabledFiltered (OutputType o, bool enabled)
 Enable or disable a specific generator.
 
void clear ()
 
void codify (const QCString &s)
 
void stripCodeComments (bool b)
 
void startSpecialComment ()
 
void endSpecialComment ()
 
void setStripIndentAmount (size_t amount)
 
void writeCodeLink (CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip)
 
void writeLineNumber (const QCString &ref, const QCString &file, const QCString &anchor, int lineNumber, bool writeLineAnchor)
 
void writeTooltip (const QCString &id, const DocLinkInfo &docInfo, const QCString &decl, const QCString &desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo)
 
void startCodeLine (int lineNr)
 
void endCodeLine ()
 
void startFontClass (const QCString &c)
 
void endFontClass ()
 
void writeCodeAnchor (const QCString &name)
 
void startCodeFragment (const QCString &style)
 
void endCodeFragment (const QCString &style)
 
void startFold (int lineNr, const QCString &startMarker, const QCString &endMarker)
 
void endFold ()
 

Private Member Functions

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

Private Attributes

std::vector< OutputCodeElemm_outputCodeList
 
int m_id = -1
 

Detailed Description

Class representing a list of different code generators.

It offers the same interface as the specific code generators, and will forward each method to all generators that are enabled.

Definition at line 163 of file outputlist.h.

Member Typedef Documentation

◆ OutputCodeIntfPtr

Definition at line 166 of file outputlist.h.

Member Function Documentation

◆ add() [1/2]

template<class T, class... As>
T * OutputCodeList::add ( As &&... args)
inline

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

Definition at line 201 of file outputlist.h.

202 {
203 add(std::make_unique<T>(std::forward<As>(args)...));
204 return static_cast<T*>(m_outputCodeList.back().intf.get());
205 }
std::vector< OutputCodeElem > m_outputCodeList
Definition outputlist.h:303
void add(OutputCodeIntfPtr &&p)
Definition outputlist.h:194

References add(), and m_outputCodeList.

◆ add() [2/2]

◆ clear()

void OutputCodeList::clear ( )
inline

Definition at line 227 of file outputlist.h.

228 {
229 m_outputCodeList.clear();
230 }

References m_outputCodeList.

◆ codify()

void OutputCodeList::codify ( const QCString & s)
inline

Definition at line 234 of file outputlist.h.

235 { foreach(&OutputCodeIntf::codify,s); }
virtual void codify(const QCString &s)=0

References OutputCodeIntf::codify().

Referenced by FileCodeParser::parseCode().

◆ endCodeFragment()

void OutputCodeList::endCodeFragment ( const QCString & style)
inline

Definition at line 281 of file outputlist.h.

282 { foreach(&OutputCodeIntf::endCodeFragment,style); }
virtual void endCodeFragment(const QCString &style)=0

References OutputCodeIntf::endCodeFragment().

Referenced by writeXMLCodeBlock().

◆ endCodeLine()

void OutputCodeList::endCodeLine ( )
inline

Definition at line 266 of file outputlist.h.

267 { foreach(&OutputCodeIntf::endCodeLine); }
virtual void endCodeLine()=0

References OutputCodeIntf::endCodeLine().

Referenced by FileCodeParser::parseCode(), and OutputCodeRecorder::replay().

◆ endFold()

void OutputCodeList::endFold ( )
inline

Definition at line 287 of file outputlist.h.

288 { foreach(&OutputCodeIntf::endFold); }
virtual void endFold()=0

References OutputCodeIntf::endFold().

◆ endFontClass()

void OutputCodeList::endFontClass ( )
inline

Definition at line 272 of file outputlist.h.

273 { foreach(&OutputCodeIntf::endFontClass); }
virtual void endFontClass()=0

References OutputCodeIntf::endFontClass().

◆ endSpecialComment()

void OutputCodeList::endSpecialComment ( )
inline

Definition at line 243 of file outputlist.h.

virtual void endSpecialComment()=0

References OutputCodeIntf::endSpecialComment().

Referenced by OutputCodeRecorder::replay().

◆ foreach()

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

Definition at line 292 of file outputlist.h.

293 {
294 for (auto &e : m_outputCodeList)
295 {
296 if (e.enabled)
297 {
298 (e.intf.get()->*methodPtr)(std::forward<As>(args)...);
299 }
300 }
301 }

References m_outputCodeList.

◆ get()

template<class T>
T * OutputCodeList::get ( OutputType o)
inline

Returns a pointer to a specific generator in the list.

Definition at line 209 of file outputlist.h.

210 {
211 for (auto &e : m_outputCodeList)
212 {
213 if (e.intf->type()==o) { return static_cast<T*>(e.intf.get()); }
214 }
215 return nullptr;
216 }

References m_outputCodeList.

◆ id()

int OutputCodeList::id ( ) const
inline

Definition at line 191 of file outputlist.h.

191{ return m_id; }

References m_id.

Referenced by setId(), and TooltipManager::writeTooltips().

◆ setEnabledFiltered()

void OutputCodeList::setEnabledFiltered ( OutputType o,
bool enabled )
inline

Enable or disable a specific generator.

Definition at line 219 of file outputlist.h.

220 {
221 for (auto &e : m_outputCodeList)
222 {
223 if (e.intf->type()==o) e.enabled = enabled;
224 }
225 }

References m_outputCodeList.

◆ setId()

void OutputCodeList::setId ( int id)
inline

Definition at line 192 of file outputlist.h.

192{ m_id = id; }
int id() const
Definition outputlist.h:191

References id(), and m_id.

◆ setStripIndentAmount()

void OutputCodeList::setStripIndentAmount ( size_t amount)
inline

Definition at line 246 of file outputlist.h.

247 { foreach(&OutputCodeIntf::setStripIndentAmount,amount); }
virtual void setStripIndentAmount(size_t)=0

References OutputCodeIntf::setStripIndentAmount().

Referenced by OutputCodeRecorder::replay().

◆ startCodeFragment()

void OutputCodeList::startCodeFragment ( const QCString & style)
inline

◆ startCodeLine()

void OutputCodeList::startCodeLine ( int lineNr)
inline

Definition at line 263 of file outputlist.h.

264 { foreach(&OutputCodeIntf::startCodeLine,lineNr); }
virtual void startCodeLine(int lineNr)=0

References OutputCodeIntf::startCodeLine().

Referenced by FileCodeParser::parseCode().

◆ startFold()

void OutputCodeList::startFold ( int lineNr,
const QCString & startMarker,
const QCString & endMarker )
inline

Definition at line 284 of file outputlist.h.

285 { foreach(&OutputCodeIntf::startFold,lineNr,startMarker,endMarker); }
virtual void startFold(int lineNr, const QCString &startMarker, const QCString &endMarker)=0

References OutputCodeIntf::startFold().

◆ startFontClass()

void OutputCodeList::startFontClass ( const QCString & c)
inline

Definition at line 269 of file outputlist.h.

270 { foreach(&OutputCodeIntf::startFontClass,c); }
virtual void startFontClass(const QCString &c)=0

References OutputCodeIntf::startFontClass().

Referenced by startFonts().

◆ startSpecialComment()

void OutputCodeList::startSpecialComment ( )
inline

Definition at line 240 of file outputlist.h.

virtual void startSpecialComment()=0

References OutputCodeIntf::startSpecialComment().

Referenced by OutputCodeRecorder::replay().

◆ stripCodeComments()

void OutputCodeList::stripCodeComments ( bool b)
inline

◆ writeCodeAnchor()

void OutputCodeList::writeCodeAnchor ( const QCString & name)
inline

Definition at line 275 of file outputlist.h.

276 { foreach(&OutputCodeIntf::writeCodeAnchor,name); }
virtual void writeCodeAnchor(const QCString &name)=0

References OutputCodeIntf::writeCodeAnchor().

Referenced by generateClassMemberLink(), generateClassOrGlobalLink(), and getLinkInScope().

◆ writeCodeLink()

void OutputCodeList::writeCodeLink ( CodeSymbolType type,
const QCString & ref,
const QCString & file,
const QCString & anchor,
const QCString & name,
const QCString & tooltip )
inline

Definition at line 249 of file outputlist.h.

253 { foreach(&OutputCodeIntf::writeCodeLink,type,ref,file,anchor,name,tooltip); }
virtual void writeCodeLink(CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip)=0

References OutputCodeIntf::writeCodeLink().

Referenced by writeMultiLineCodeLink(), writeMultiLineCodeLink(), writeMultiLineCodeLink(), and writeMultiLineCodeLink().

◆ writeLineNumber()

void OutputCodeList::writeLineNumber ( const QCString & ref,
const QCString & file,
const QCString & anchor,
int lineNumber,
bool writeLineAnchor )
inline

Definition at line 255 of file outputlist.h.

257 { foreach(&OutputCodeIntf::writeLineNumber,ref,file,anchor,lineNumber,writeLineAnchor); }
virtual void writeLineNumber(const QCString &ref, const QCString &file, const QCString &anchor, int lineNumber, bool writeLineAnchor)=0

References OutputCodeIntf::writeLineNumber().

Referenced by FileCodeParser::parseCode().

◆ writeTooltip()

void OutputCodeList::writeTooltip ( const QCString & id,
const DocLinkInfo & docInfo,
const QCString & decl,
const QCString & desc,
const SourceLinkInfo & defInfo,
const SourceLinkInfo & declInfo )
inline

Definition at line 259 of file outputlist.h.

261 { foreach(&OutputCodeIntf::writeTooltip,id,docInfo,decl,desc,defInfo,declInfo); }
virtual void writeTooltip(const QCString &id, const DocLinkInfo &docInfo, const QCString &decl, const QCString &desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo)=0

References OutputCodeIntf::writeTooltip().

Referenced by TooltipManager::writeTooltips().

Member Data Documentation

◆ m_id

int OutputCodeList::m_id = -1
private

Definition at line 304 of file outputlist.h.

Referenced by id(), and setId().

◆ m_outputCodeList

std::vector<OutputCodeElem> OutputCodeList::m_outputCodeList
private

Definition at line 303 of file outputlist.h.

Referenced by add(), add(), clear(), foreach(), get(), and setEnabledFiltered().


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