Skip to main content

The DocNodeList Struct Reference

Declaration

struct DocNodeList { ... }

Included Headers

#include <src/docnode.h>

Base struct

classGrowVector<T>

std::vector like container optimized for pushing elements to the back. More...

Public Member Functions Index

template <class T, class... Args>
voidappend (Args &&... args)

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

voidmove_append (DocNodeList &l)

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

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. More...

Definition at line 118 of file docnode.h.

Public Member Functions

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 124 of file docnode.h.

1399inline void DocNodeList::append(Args&&... args)
1400{
1401 // add a DocNodeVariant to the list containing an node T as its active member.
1402 emplace_back(T(std::forward<Args>(args)...));
1403 // store a pointer to the variant holding node T inside the node itself.
1404 // Since DocNodeList is a GrowVector this reference will remain valid even if new
1405 // elements are added (which would not be the case if a std::vector was used)
1406 std::get_if<T>(&back())->setThisVariant(&back());
1407}

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.

Declaration at line 128 of file docnode.h, definition at line 816 of file docnode.cpp.

817{
818 for (auto &&elem : elements)
819 {
820 emplace_back(std::move(elem));
821 }
822 elements.clear();
823}

References GrowVector< T >::clear and GrowVector< DocNodeVariant >::emplace_back.

Referenced by flattenParagraphs.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.