Doxygen
Loading...
Searching...
No Matches
DocNodeList Struct Reference

#include <src/docnode.h>

+ Inheritance diagram for DocNodeList:
+ Collaboration diagram for DocNodeList:

Public Member Functions

template<class T, class... Args>
void append (Args &&... args)
 Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
 
void move_append (DocNodeList &l)
 moves the element of list l at the end of this list.
 
template<class T>
T * get_last ()
 Returns a pointer to the last element in the list if that element exists and holds a T, otherwise nullptr is returned.
 
- Public Member Functions inherited from GrowVector< DocNodeVariant >
iterator begin ()
 returns an iterator to the beginning
 
const_iterator begin () const
 returns an iterator to the beginning
 
iterator end ()
 returns an iterator to the end
 
const_iterator end () const
 returns an iterator to the end
 
size_t size () const
 returns the number of elements
 
void push_back (DocNodeVariant &&t)
 adds an element to the end
 
void emplace_back (Args &&...args)
 constructs an element in-place at the end
 
void pop_back ()
 removes the last element
 
DocNodeVariantat (size_t i)
 access specified element
 
const DocNodeVariantat (size_t i) const
 access specified element
 
DocNodeVariantfront ()
 access the first element
 
const DocNodeVariantfront () const
 access the first element
 
DocNodeVariantback ()
 access the last element
 
const DocNodeVariantback () const
 access the last element
 
bool empty () const
 checks whether the container is empty
 
void clear ()
 clears the contents
 

Additional Inherited Members

- Public Types inherited from GrowVector< DocNodeVariant >
using iterator
 
using const_iterator
 

Detailed Description

Definition at line 117 of file docnode.h.

Member Function Documentation

◆ append()

template<class T, class... Args>
void DocNodeList::append ( Args &&... args)
inline

Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.

Definition at line 1393 of file docnode.h.

1394{
1395 // add a DocNodeVariant to the list containing an node T as its active member.
1396 emplace_back(T(std::forward<Args>(args)...));
1397 // store a pointer to the variant holding node T inside the node itself.
1398 // Since DocNodeList is a GrowVector this reference will remain valid even if new
1399 // elements are added (which would not be the case if a std::vector was used)
1400 std::get_if<T>(&back())->setThisVariant(&back());
1401}
DocNodeVariant & back()
Definition growvector.h:135
void emplace_back(Args &&...args)
Definition growvector.h:108

References GrowVector< DocNodeVariant >::back(), and GrowVector< DocNodeVariant >::emplace_back().

Referenced by DocSimpleSect::appendLinkWord(), DocParser::defaultHandleToken(), DocParser::errorHandleDefaultToken(), DocParser::handleAHref(), DocParser::handleAnchor(), DocPara::handleCite(), DocPara::handleCommand(), DocPara::handleDoxyConfig(), DocPara::handleEmoji(), DocPara::handleFile(), DocPara::handleHtmlEndTag(), DocPara::handleHtmlHeader(), DocPara::handleHtmlStartTag(), DocParser::handleImage(), DocParser::handleImg(), DocPara::handleInclude(), DocPara::handleIncludeOperator(), DocParser::handleInternalRef(), DocPara::handleLink(), DocParser::handleLinkedWord(), DocParser::handleParameterType(), DocPara::handleParamSection(), DocParser::handlePendingStyleCommands(), DocPara::handleRef(), DocPara::handleShowDate(), DocPara::handleSimpleSection(), DocPara::handleStartCode(), DocParser::handleStyleEnter(), DocParser::handleStyleLeave(), DocPara::handleVhdlFlow(), DocPara::handleXRefItem(), DocParser::internalValidatingParseDoc(), DocAutoList::parse(), DocAutoListItem::parse(), DocHRef::parse(), DocHtmlBlockQuote::parse(), DocHtmlCell::parse(), DocHtmlDescData::parse(), DocHtmlDescList::parse(), DocHtmlDescTitle::parse(), DocHtmlDetails::parse(), DocHtmlHeader::parse(), DocHtmlList::parse(), DocHtmlListItem::parse(), DocHtmlRow::parse(), DocHtmlTable::parse(), DocInternal::parse(), DocLink::parse(), DocPara::parse(), DocParamSect::parse(), DocParBlock::parse(), DocRoot::parse(), DocSecRefList::parse(), DocSection::parse(), DocSimpleList::parse(), DocSimpleSect::parse(), DocText::parse(), DocHtmlCell::parseXml(), DocHtmlList::parseXml(), DocHtmlListItem::parseXml(), DocHtmlRow::parseXml(), DocHtmlTable::parseXml(), and DocSimpleSect::parseXml().

◆ get_last()

◆ move_append()

void DocNodeList::move_append ( DocNodeList & l)

moves the element of list l at the end of this list.

List l will become empty.

Definition at line 800 of file docnode.cpp.

801{
802 for (auto &&elem : elements)
803 {
804 emplace_back(std::move(elem));
805 }
806 elements.clear();
807}

References GrowVector< T >::clear(), and GrowVector< DocNodeVariant >::emplace_back().

Referenced by flattenParagraphs().


The documentation for this struct was generated from the following files: