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

A vector of MemberDef object. More...

#include <src/memberlist.h>

+ Inheritance diagram for MemberVector:

Public Types

using T = MemberDef*
 
using Vec = std::vector<T>
 
using value_type = Vec::value_type
 
using allocator_type = Vec::allocator_type
 
using size_type = Vec::size_type
 
using difference_type = Vec::difference_type
 
using reference = Vec::reference
 
using const_reference = Vec::const_reference
 
using iterator = Vec::iterator
 
using const_iterator = Vec::const_iterator
 

Public Member Functions

void push_back (const T &value)
 
void push_back (T &&value)
 
iterator erase (iterator pos)
 
iterator erase (const_iterator pos)
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
size_type size () const noexcept
 
bool empty () const noexcept
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
reference operator[] (size_type pos)
 
const_reference operator[] (size_type pos) const
 
void sort ()
 
void inSort (MemberDef *md)
 
void remove (const MemberDef *md)
 
bool contains (const MemberDef *md) const
 
MemberDeffind (const QCString &name)
 

Static Public Member Functions

static bool lessThan (const MemberDef *md1, const MemberDef *md2)
 

Protected Attributes

Vec m_members
 

Detailed Description

A vector of MemberDef object.

Definition at line 33 of file memberlist.h.

Member Typedef Documentation

◆ allocator_type

using MemberVector::allocator_type = Vec::allocator_type

Definition at line 39 of file memberlist.h.

◆ const_iterator

using MemberVector::const_iterator = Vec::const_iterator

Definition at line 45 of file memberlist.h.

◆ const_reference

using MemberVector::const_reference = Vec::const_reference

Definition at line 43 of file memberlist.h.

◆ difference_type

using MemberVector::difference_type = Vec::difference_type

Definition at line 41 of file memberlist.h.

◆ iterator

using MemberVector::iterator = Vec::iterator

Definition at line 44 of file memberlist.h.

◆ reference

using MemberVector::reference = Vec::reference

Definition at line 42 of file memberlist.h.

◆ size_type

using MemberVector::size_type = Vec::size_type

Definition at line 40 of file memberlist.h.

◆ T

Definition at line 36 of file memberlist.h.

◆ value_type

using MemberVector::value_type = Vec::value_type

Definition at line 38 of file memberlist.h.

◆ Vec

using MemberVector::Vec = std::vector<T>

Definition at line 37 of file memberlist.h.

Member Function Documentation

◆ back() [1/2]

reference MemberVector::back ( )
inline

Definition at line 64 of file memberlist.h.

64{ return m_members.back(); }

References m_members.

◆ back() [2/2]

const_reference MemberVector::back ( ) const
inline

Definition at line 65 of file memberlist.h.

65{ return m_members.back(); }

References m_members.

◆ begin() [1/2]

const_iterator MemberVector::begin ( ) const
inlinenoexcept

Definition at line 54 of file memberlist.h.

54{ return m_members.begin(); }

References m_members.

◆ begin() [2/2]

iterator MemberVector::begin ( )
inlinenoexcept

Definition at line 53 of file memberlist.h.

53{ return m_members.begin(); }

References m_members.

Referenced by MemberDefImpl::_writeReimplementedBy(), and refMapToVector().

◆ contains()

bool MemberVector::contains ( const MemberDef * md) const
inline

Definition at line 88 of file memberlist.h.

89 {
90 return std::find(m_members.begin(),m_members.end(),md)!=m_members.end();
91 }

References m_members.

Referenced by ModuleDefImpl::addMemberToModule(), and FileDefImpl::insertMember().

◆ empty()

◆ end() [1/2]

const_iterator MemberVector::end ( ) const
inlinenoexcept

Definition at line 56 of file memberlist.h.

56{ return m_members.end(); }

References m_members.

◆ end() [2/2]

iterator MemberVector::end ( )
inlinenoexcept

Definition at line 55 of file memberlist.h.

55{ return m_members.end(); }

References m_members.

Referenced by MemberDefImpl::_writeReimplementedBy(), and refMapToVector().

◆ erase() [1/2]

iterator MemberVector::erase ( const_iterator pos)
inline

Definition at line 51 of file memberlist.h.

51{ return m_members.erase(pos); }

References m_members.

◆ erase() [2/2]

iterator MemberVector::erase ( iterator pos)
inline

Definition at line 50 of file memberlist.h.

50{ return m_members.erase(pos); }

References m_members.

Referenced by remove().

◆ find()

MemberDef * MemberVector::find ( const QCString & name)
inline

Definition at line 92 of file memberlist.h.

93 {
94 auto it = std::find_if(m_members.begin(),m_members.end(),[name=name](auto &el) { return el->name()==name; });
95 if (it != m_members.end())
96 {
97 return *it;
98 }
99
100 return nullptr;
101 }

References m_members.

Referenced by tryAddEnumDocsToGroupMember().

◆ front() [1/2]

reference MemberVector::front ( )
inline

Definition at line 61 of file memberlist.h.

61{ return m_members.front(); }

References m_members.

◆ front() [2/2]

const_reference MemberVector::front ( ) const
inline

Definition at line 62 of file memberlist.h.

62{ return m_members.front(); }

References m_members.

◆ inSort()

void MemberVector::inSort ( MemberDef * md)
inline

Definition at line 79 of file memberlist.h.

80 {
81 m_members.insert( std::upper_bound( m_members.begin(), m_members.end(), md, lessThan), md);
82 }
static bool lessThan(const MemberDef *md1, const MemberDef *md2)
Definition memberlist.h:71

References lessThan(), and m_members.

◆ lessThan()

static bool MemberVector::lessThan ( const MemberDef * md1,
const MemberDef * md2 )
inlinestatic

Definition at line 71 of file memberlist.h.

72 {
73 return genericCompareMembers(md1,md2)<0;
74 }
int genericCompareMembers(const MemberDef *c1, const MemberDef *c2)

References genericCompareMembers().

Referenced by inSort(), and sort().

◆ operator[]() [1/2]

reference MemberVector::operator[] ( size_type pos)
inline

Definition at line 67 of file memberlist.h.

67{ return m_members.operator[](pos); }

References m_members.

◆ operator[]() [2/2]

const_reference MemberVector::operator[] ( size_type pos) const
inline

Definition at line 68 of file memberlist.h.

68{ return m_members.operator[](pos); }

References m_members.

◆ push_back() [1/2]

void MemberVector::push_back ( const T & value)
inline

◆ push_back() [2/2]

void MemberVector::push_back ( T && value)
inline

Definition at line 48 of file memberlist.h.

48{ m_members.push_back(std::move(value)); }

References m_members.

◆ remove()

void MemberVector::remove ( const MemberDef * md)
inline

Definition at line 83 of file memberlist.h.

84 {
85 auto it = std::find(m_members.begin(),m_members.end(),md);
86 if (it!=m_members.end()) erase(it);
87 }
iterator erase(iterator pos)
Definition memberlist.h:50

References erase(), and m_members.

Referenced by addMembersToMemberGroup(), FileDefImpl::removeMemberFromList(), and GroupDefImpl::removeMemberFromList().

◆ size()

size_type MemberVector::size ( ) const
inlinenoexcept

Definition at line 58 of file memberlist.h.

58{ return m_members.size(); }

References m_members.

◆ sort()

void MemberVector::sort ( )
inline

Definition at line 75 of file memberlist.h.

76 {
77 std::stable_sort(m_members.begin(),m_members.end(),lessThan);
78 }

References lessThan(), and m_members.

Referenced by FileDefImpl::sortMemberLists(), FileDefImpl::writeDocumentation(), and NamespaceDefImpl::writeDocumentation().

Member Data Documentation

◆ m_members


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