libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::GrpSubGroupSet Class Reference

#include <grpsubgroupset.h>

Public Member Functions

 GrpSubGroupSet ()
 GrpSubGroupSet (const GrpSubGroupSet &other)
 ~GrpSubGroupSet ()
unsigned int size () const
void addAll (const GrpSubGroupSet &other)
void remove (GrpSubGroup *p_remove_sub_group)
void add (GrpSubGroup *p_add_sub_group)
std::list< GrpSubGroup * >::iterator erase (std::list< GrpSubGroup * >::iterator it)
std::list< GrpSubGroup * >::const_iterator begin () const
std::list< GrpSubGroup * >::const_iterator end () const
bool contains (GrpSubGroup *get) const
const QString printInfos () const

Private Attributes

friend GrpGroup
std::list< GrpSubGroup * > m_grpSubGroupPtrList

Detailed Description

Definition at line 33 of file grpsubgroupset.h.

Constructor & Destructor Documentation

◆ GrpSubGroupSet() [1/2]

pappso::GrpSubGroupSet::GrpSubGroupSet ( )

Definition at line 30 of file grpsubgroupset.cpp.

31{
32}

Referenced by GrpSubGroupSet(), and addAll().

◆ GrpSubGroupSet() [2/2]

pappso::GrpSubGroupSet::GrpSubGroupSet ( const GrpSubGroupSet & other)

Definition at line 34 of file grpsubgroupset.cpp.

35 : m_grpSubGroupPtrList(other.m_grpSubGroupPtrList)
36{
37}
std::list< GrpSubGroup * > m_grpSubGroupPtrList

References GrpSubGroupSet(), and m_grpSubGroupPtrList.

◆ ~GrpSubGroupSet()

pappso::GrpSubGroupSet::~GrpSubGroupSet ( )

Definition at line 39 of file grpsubgroupset.cpp.

40{
41}

Member Function Documentation

◆ add()

void pappso::GrpSubGroupSet::add ( GrpSubGroup * p_add_sub_group)

Definition at line 110 of file grpsubgroupset.cpp.

111{
112
113 std::list<GrpSubGroup *>::iterator it(m_grpSubGroupPtrList.begin()),
114 itEnd(m_grpSubGroupPtrList.end());
115
116
117 while(it != itEnd)
118 {
119 if(p_add_sub_group == *it)
120 {
121 // this subgroup is already in list
122 return;
123 }
124 if(p_add_sub_group > *it)
125 {
126 it = m_grpSubGroupPtrList.insert(it, p_add_sub_group);
127 return;
128 }
129 it++;
130 }
131 m_grpSubGroupPtrList.push_back(p_add_sub_group);
132}

References m_grpSubGroupPtrList.

◆ addAll()

void pappso::GrpSubGroupSet::addAll ( const GrpSubGroupSet & other)

Definition at line 45 of file grpsubgroupset.cpp.

46{
47
48 std::list<GrpSubGroup *>::iterator it(m_grpSubGroupPtrList.begin());
49 std::list<GrpSubGroup *>::iterator itEnd(m_grpSubGroupPtrList.end());
50 std::list<GrpSubGroup *>::const_iterator itIn(other.m_grpSubGroupPtrList.begin());
51 std::list<GrpSubGroup *>::const_iterator itInEnd(other.m_grpSubGroupPtrList.end());
52
53 while((itIn != itInEnd) && (it != itEnd))
54 {
55 if(*itIn < *it)
56 {
57 it++;
58 continue;
59 }
60 if(*itIn > *it)
61 {
62 it = m_grpSubGroupPtrList.insert(it, *itIn);
63 it++;
64 itIn++;
65 continue;
66 }
67 if(*itIn == *it)
68 {
69 itIn++;
70 it++;
71 }
72 }
73 while(itIn != itInEnd)
74 {
75 m_grpSubGroupPtrList.push_back(*itIn);
76 itIn++;
77 }
78}

References GrpSubGroupSet(), and m_grpSubGroupPtrList.

Referenced by pappso::GrpMapPeptideToSubGroupSet::getSubGroupSet().

◆ begin()

std::list< GrpSubGroup * >::const_iterator pappso::GrpSubGroupSet::begin ( ) const
inline

Definition at line 58 of file grpsubgroupset.h.

59 {
60 return m_grpSubGroupPtrList.begin();
61 };

References m_grpSubGroupPtrList.

◆ contains()

bool pappso::GrpSubGroupSet::contains ( GrpSubGroup * get) const

Definition at line 87 of file grpsubgroupset.cpp.

88{
89
90 std::list<GrpSubGroup *>::const_iterator it(m_grpSubGroupPtrList.begin()),
91 itEnd(m_grpSubGroupPtrList.end());
92
93
94 while(it != itEnd)
95 {
96 if(p_sub_group == *it)
97 {
98 // this subgroup is already in list
99 return true;
100 }
101 if(p_sub_group > *it)
102 {
103 return false;
104 }
105 it++;
106 }
107 return false;
108}

References m_grpSubGroupPtrList.

Referenced by pappso::GrpGroup::addSubGroupSp().

◆ end()

std::list< GrpSubGroup * >::const_iterator pappso::GrpSubGroupSet::end ( ) const
inline

Definition at line 63 of file grpsubgroupset.h.

64 {
65 return m_grpSubGroupPtrList.end();
66 };

References m_grpSubGroupPtrList.

◆ erase()

std::list< GrpSubGroup * >::iterator pappso::GrpSubGroupSet::erase ( std::list< GrpSubGroup * >::iterator it)
inline

Definition at line 53 of file grpsubgroupset.h.

54 {
55 return m_grpSubGroupPtrList.erase(it);
56 };

References m_grpSubGroupPtrList.

Referenced by pappso::GrpGroup::addSubGroupSp().

◆ printInfos()

const QString pappso::GrpSubGroupSet::printInfos ( ) const

Definition at line 136 of file grpsubgroupset.cpp.

137{
138 QString infos;
139 std::list<GrpSubGroup *>::const_iterator it(m_grpSubGroupPtrList.begin()),
140 itEnd(m_grpSubGroupPtrList.end());
141
142
143 while(it != itEnd)
144 {
145 infos.append((*it)->getFirstAccession() + " " +
146 QString("0x%1").arg((quintptr)*it, QT_POINTER_SIZE * 2, 16, QChar('0')) + "\n");
147 it++;
148 }
149
150 return infos;
151}

References m_grpSubGroupPtrList.

Referenced by pappso::GrpGroup::check().

◆ remove()

void pappso::GrpSubGroupSet::remove ( GrpSubGroup * p_remove_sub_group)

Definition at line 81 of file grpsubgroupset.cpp.

82{
83 m_grpSubGroupPtrList.remove(p_remove_sub_group);
84}

References m_grpSubGroupPtrList.

◆ size()

unsigned int pappso::GrpSubGroupSet::size ( ) const
inline

Definition at line 45 of file grpsubgroupset.h.

46 {
47 return m_grpSubGroupPtrList.size();
48 };

References m_grpSubGroupPtrList.

Member Data Documentation

◆ GrpGroup

friend pappso::GrpSubGroupSet::GrpGroup
private

Definition at line 35 of file grpsubgroupset.h.

◆ m_grpSubGroupPtrList

std::list<GrpSubGroup *> pappso::GrpSubGroupSet::m_grpSubGroupPtrList
private

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