Doxygen
Loading...
Searching...
No Matches
DocNodeList Class Referencefinal

#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
iterator end ()
 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
DocNodeVariant & at (size_t i)
 access specified element
DocNodeVariant & front ()
 access the first element
DocNodeVariant & back ()
 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 1404 of file docnode.h.

1405{
1406 // add a DocNodeVariant to the list containing an node T as its active member.
1407 emplace_back(T(std::forward<Args>(args)...));
1408 // store a pointer to the variant holding node T inside the node itself.
1409 // Since DocNodeList is a GrowVector this reference will remain valid even if new
1410 // elements are added (which would not be the case if a std::vector was used)
1411 std::get_if<T>(&back())->setThisVariant(&back());
1412}
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(), DocParser::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(), DocParser::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(), DocHtmlCaption::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(), DocParamList::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(), DocParamList::parseXml(), and DocSimpleSect::parseXml().

◆ get_last()

template<class T>
T * DocNodeList::get_last ( )
inline

◆ 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 864 of file docnode.cpp.

865{
866 for (auto &&elem : elements)
867 {
868 emplace_back(std::move(elem));
869 }
870 elements.clear();
871}

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

Referenced by flattenParagraphs().


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