libpappsomspp
Library for mass spectrometry
grpsubgroupset.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
3  *
4  * This file is part of the PAPPSOms++ library.
5  *
6  * PAPPSOms++ is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * PAPPSOms++ is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Contributors:
20  * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
21  *implementation
22  ******************************************************************************/
23 
24 #pragma once
25 
26 
27 #include "grpsubgroup.h"
28 
29 namespace pappso
30 {
31 class GrpGroup;
32 
33 class GrpSubGroupSet
34 {
35  friend GrpGroup;
36 
37  private:
38  std::list<GrpSubGroup *> m_grpSubGroupPtrList;
39 
40  public:
42  GrpSubGroupSet(const GrpSubGroupSet &other);
44  unsigned int
45  size() const
46  {
47  return m_grpSubGroupPtrList.size();
48  };
49  void addAll(const GrpSubGroupSet &other);
50  void remove(GrpSubGroup *p_remove_sub_group);
51  void add(GrpSubGroup *p_add_sub_group);
52  std::list<GrpSubGroup *>::iterator
53  erase(std::list<GrpSubGroup *>::iterator it)
54  {
55  return m_grpSubGroupPtrList.erase(it);
56  };
57  std::list<GrpSubGroup *>::const_iterator
58  begin() const
59  {
60  return m_grpSubGroupPtrList.begin();
61  };
62  std::list<GrpSubGroup *>::const_iterator
63  end() const
64  {
65  return m_grpSubGroupPtrList.end();
66  };
67  bool contains(GrpSubGroup *get) const;
68 
69  const QString printInfos() const;
70 };
71 
72 
73 } // namespace pappso
pappso::GrpSubGroup
Definition: grpsubgroup.h:63
pappso::GrpSubGroupSet::GrpSubGroupSet
GrpSubGroupSet()
Definition: grpsubgroupset.cpp:51
pappso::GrpSubGroupSet::GrpGroup
friend GrpGroup
Definition: grpsubgroupset.h:56
pappso
Definition: aa.cpp:38
grpsubgroup.h
pappso::GrpSubGroupSet::contains
bool contains(GrpSubGroup *get) const
Definition: grpsubgroupset.cpp:110
pappso::GrpSubGroupSet::addAll
void addAll(const GrpSubGroupSet &other)
Definition: grpsubgroupset.cpp:66
pappso::GrpSubGroupSet::begin
std::list< GrpSubGroup * >::const_iterator begin() const
Definition: grpsubgroupset.h:79
pappso::GrpSubGroupSet::~GrpSubGroupSet
~GrpSubGroupSet()
Definition: grpsubgroupset.cpp:60
pappso::GrpSubGroupSet::end
std::list< GrpSubGroup * >::const_iterator end() const
Definition: grpsubgroupset.h:84
pappso::GrpSubGroupSet::size
unsigned int size() const
Definition: grpsubgroupset.h:66
pappso::GrpSubGroupSet::erase
std::list< GrpSubGroup * >::iterator erase(std::list< GrpSubGroup * >::iterator it)
Definition: grpsubgroupset.h:74
pappso::GrpSubGroupSet::remove
void remove(GrpSubGroup *p_remove_sub_group)
Definition: grpsubgroupset.cpp:104
pappso::GrpSubGroupSet::printInfos
const QString printInfos() const
Definition: grpsubgroupset.cpp:159
pappso::GrpSubGroupSet::add
void add(GrpSubGroup *p_add_sub_group)
Definition: grpsubgroupset.cpp:133
pappso::GrpSubGroupSet::m_grpSubGroupPtrList
std::list< GrpSubGroup * > m_grpSubGroupPtrList
Definition: grpsubgroupset.h:59