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

class that represents a list of constant references to sections. More...

#include <src/section.h>

Public Types

using const_iterator = SectionInfoVec::const_iterator
 

Public Member Functions

const SectionInfofind (const QCString &label) const
 Returns a constant pointer to the section info given a section label or nullptr if no section with the given label can be found.
 
void add (const SectionInfo *si)
 Adds a non-owning section reference.
 
const_iterator begin () const
 
const_iterator end () const
 
bool empty () const
 
size_t size () const
 

Private Types

using SectionInfoVec = std::vector<const SectionInfo*>
 

Private Attributes

SectionInfoVec m_entries
 
std::unordered_map< std::string, const SectionInfo * > m_lookup
 

Detailed Description

class that represents a list of constant references to sections.

Definition at line 101 of file section.h.

Member Typedef Documentation

◆ const_iterator

using SectionRefs::const_iterator = SectionInfoVec::const_iterator

Definition at line 105 of file section.h.

◆ SectionInfoVec

using SectionRefs::SectionInfoVec = std::vector<const SectionInfo*>
private

Definition at line 103 of file section.h.

Member Function Documentation

◆ add()

void SectionRefs::add ( const SectionInfo * si)
inline

Adds a non-owning section reference.

Definition at line 116 of file section.h.

117 {
118 m_lookup.emplace(toStdString(si->label()),si);
119 m_entries.push_back(si);
120 }
QCString label() const
Definition section.h:68
SectionInfoVec m_entries
Definition section.h:128
std::unordered_map< std::string, const SectionInfo * > m_lookup
Definition section.h:129
std::string toStdString(const QCString &s)
Definition qcstring.h:687

References SectionInfo::label(), m_entries, m_lookup, and toStdString().

◆ begin()

const_iterator SectionRefs::begin ( ) const
inline

Definition at line 122 of file section.h.

122{ return m_entries.cbegin(); }

References m_entries.

Referenced by PageDefImpl::addSectionsToIndex().

◆ empty()

bool SectionRefs::empty ( ) const
inline

Definition at line 124 of file section.h.

124{ return m_entries.empty(); }

References m_entries.

Referenced by PageDefImpl::addSectionsToIndex(), and generateXMLForPage().

◆ end()

const_iterator SectionRefs::end ( ) const
inline

Definition at line 123 of file section.h.

123{ return m_entries.cend(); }

References m_entries.

Referenced by PageDefImpl::addSectionsToIndex().

◆ find()

const SectionInfo * SectionRefs::find ( const QCString & label) const
inline

Returns a constant pointer to the section info given a section label or nullptr if no section with the given label can be found.

Definition at line 109 of file section.h.

110 {
111 auto it = m_lookup.find(label.str());
112 return it!=m_lookup.end() ? it->second : nullptr;
113 }
const std::string & str() const
Definition qcstring.h:537

References m_lookup, and QCString::str().

◆ size()

size_t SectionRefs::size ( ) const
inline

Definition at line 125 of file section.h.

125{ return m_entries.size(); }

References m_entries.

Member Data Documentation

◆ m_entries

SectionInfoVec SectionRefs::m_entries
private

Definition at line 128 of file section.h.

Referenced by add(), begin(), empty(), end(), and size().

◆ m_lookup

std::unordered_map< std::string, const SectionInfo* > SectionRefs::m_lookup
private

Definition at line 129 of file section.h.

Referenced by add(), and find().


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