libpappsomspp
Library for mass spectrometry
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 54 of file grpsubgroupset.h.

Constructor & Destructor Documentation

◆ GrpSubGroupSet() [1/2]

pappso::GrpSubGroupSet::GrpSubGroupSet ( )

Definition at line 51 of file grpsubgroupset.cpp.

56  {

◆ GrpSubGroupSet() [2/2]

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

Definition at line 55 of file grpsubgroupset.cpp.

56  {
57  if(*itIn < *it)
58  {

◆ ~GrpSubGroupSet()

pappso::GrpSubGroupSet::~GrpSubGroupSet ( )

Definition at line 60 of file grpsubgroupset.cpp.

63  {

Member Function Documentation

◆ add()

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

Definition at line 133 of file grpsubgroupset.cpp.

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

◆ addAll()

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

Definition at line 66 of file grpsubgroupset.cpp.

70  {
71  itIn++;
72  it++;
73  }
74  }
75  while(itIn != itInEnd)
76  {
77  m_grpSubGroupPtrList.push_back(*itIn);
78  itIn++;
79  }
80 }
81 
82 void
83 GrpSubGroupSet::remove(GrpSubGroup *p_remove_sub_group)
84 {
85  m_grpSubGroupPtrList.remove(p_remove_sub_group);
86 }
87 
88 bool
89 GrpSubGroupSet::contains(GrpSubGroup *p_sub_group) const
90 {
91 
92  std::list<GrpSubGroup *>::const_iterator it(m_grpSubGroupPtrList.begin()),
93  itEnd(m_grpSubGroupPtrList.end());
94 
95 
96  while(it != itEnd)
97  {
98  if(p_sub_group == *it)
99  {
100  // this subgroup is already in list
101  return true;

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

◆ begin()

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

Definition at line 79 of file grpsubgroupset.h.

◆ contains()

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

Definition at line 110 of file grpsubgroupset.cpp.

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

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

◆ end()

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

Definition at line 84 of file grpsubgroupset.h.

◆ erase()

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

Definition at line 74 of file grpsubgroupset.h.

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

◆ printInfos()

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

Definition at line 159 of file grpsubgroupset.cpp.

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

◆ remove()

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

Definition at line 104 of file grpsubgroupset.cpp.

104  {
105  return false;
106  }
107  it++;

◆ size()

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

Definition at line 66 of file grpsubgroupset.h.

Member Data Documentation

◆ GrpGroup

friend pappso::GrpSubGroupSet::GrpGroup
private

Definition at line 56 of file grpsubgroupset.h.

◆ m_grpSubGroupPtrList

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

Definition at line 59 of file grpsubgroupset.h.

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


The documentation for this class was generated from the following files:
pappso::GrpSubGroupSet::contains
bool contains(GrpSubGroup *get) const
Definition: grpsubgroupset.cpp:110
pappso::GrpSubGroupSet::remove
void remove(GrpSubGroup *p_remove_sub_group)
Definition: grpsubgroupset.cpp:104
pappso::GrpSubGroupSet::m_grpSubGroupPtrList
std::list< GrpSubGroup * > m_grpSubGroupPtrList
Definition: grpsubgroupset.h:59