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 34 of file memberlist.h.

Member Typedef Documentation

◆ allocator_type

using MemberVector::allocator_type = Vec::allocator_type

Definition at line 40 of file memberlist.h.

◆ const_iterator

using MemberVector::const_iterator = Vec::const_iterator

Definition at line 46 of file memberlist.h.

◆ const_reference

using MemberVector::const_reference = Vec::const_reference

Definition at line 44 of file memberlist.h.

◆ difference_type

using MemberVector::difference_type = Vec::difference_type

Definition at line 42 of file memberlist.h.

◆ iterator

using MemberVector::iterator = Vec::iterator

Definition at line 45 of file memberlist.h.

◆ reference

using MemberVector::reference = Vec::reference

Definition at line 43 of file memberlist.h.

◆ size_type

using MemberVector::size_type = Vec::size_type

Definition at line 41 of file memberlist.h.

◆ T

Definition at line 37 of file memberlist.h.

◆ value_type

using MemberVector::value_type = Vec::value_type

Definition at line 39 of file memberlist.h.

◆ Vec

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

Definition at line 38 of file memberlist.h.

Member Function Documentation

◆ back() [1/2]

reference MemberVector::back ( )
inline

Definition at line 65 of file memberlist.h.

65{ return m_members.back(); }

References m_members.

◆ back() [2/2]

const_reference MemberVector::back ( ) const
inline

Definition at line 66 of file memberlist.h.

66{ return m_members.back(); }

References m_members.

◆ begin() [1/2]

const_iterator MemberVector::begin ( ) const
inlinenoexcept

Definition at line 55 of file memberlist.h.

55{ return m_members.begin(); }

References m_members.

◆ begin() [2/2]

iterator MemberVector::begin ( )
inlinenoexcept

Definition at line 54 of file memberlist.h.

54{ 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 89 of file memberlist.h.

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

References m_members.

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

◆ empty()

◆ end() [1/2]

const_iterator MemberVector::end ( ) const
inlinenoexcept

Definition at line 57 of file memberlist.h.

57{ return m_members.end(); }

References m_members.

◆ end() [2/2]

iterator MemberVector::end ( )
inlinenoexcept

Definition at line 56 of file memberlist.h.

56{ 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 52 of file memberlist.h.

52{ return m_members.erase(pos); }

References m_members.

◆ erase() [2/2]

iterator MemberVector::erase ( iterator pos)
inline

Definition at line 51 of file memberlist.h.

51{ return m_members.erase(pos); }

References m_members.

Referenced by remove().

◆ find()

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

Definition at line 93 of file memberlist.h.

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

References m_members.

Referenced by tryAddEnumDocsToGroupMember().

◆ front() [1/2]

reference MemberVector::front ( )
inline

Definition at line 62 of file memberlist.h.

62{ return m_members.front(); }

References m_members.

◆ front() [2/2]

const_reference MemberVector::front ( ) const
inline

Definition at line 63 of file memberlist.h.

63{ return m_members.front(); }

References m_members.

◆ inSort()

void MemberVector::inSort ( MemberDef * md)
inline

Definition at line 80 of file memberlist.h.

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

References lessThan(), and m_members.

◆ lessThan()

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

Definition at line 72 of file memberlist.h.

73 {
74 return genericCompareMembers(md1,md2)<0;
75 }
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 68 of file memberlist.h.

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

References m_members.

◆ operator[]() [2/2]

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

Definition at line 69 of file memberlist.h.

69{ 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 49 of file memberlist.h.

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

References m_members.

◆ remove()

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

Definition at line 84 of file memberlist.h.

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

References erase(), and m_members.

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

◆ size()

size_type MemberVector::size ( ) const
inlinenoexcept

Definition at line 59 of file memberlist.h.

59{ return m_members.size(); }

References m_members.

◆ sort()

void MemberVector::sort ( )
inline

Definition at line 76 of file memberlist.h.

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

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: