OpenStructure
sequence_list.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_SEQ_SEQUENCE_LIST_HH
20 #define OST_SEQ_SEQUENCE_LIST_HH
21 
25 
26 namespace ost { namespace seq {
27 
28 class SequenceList;
29 
34 public:
35  friend class SequenceList;
38  typedef Iterator iterator;
40 
41  void AddSequence(const ConstSequenceHandle& sequence);
42 
44  int GetCount() const;
45 
46  ConstSequenceHandle operator[](int index) const;
47  Iterator Begin() const;
48  Iterator End() const;
49 
50  // for stl compat
51  Iterator begin() const { return Begin(); }
52  Iterator end() const { return End(); }
53 
54  bool SequencesHaveEqualLength() const;
55  bool IsValid() const;
56 
60  ConstSequenceList Take(int n) const;
61 
63  ConstSequenceList Slice(int first, int n) const;
64  int GetMinLength() const;
65  int GetMaxLength() const;
67  impl::SequenceListImplPtr& Impl() const;
69 protected:
70 
71  void CheckValidity() const;
73 };
74 
79 public:
80 
83  typedef Iterator iterator;
84  SequenceList();
85  void AddSequence(const SequenceHandle& sequence);
86 
87  bool SequencesHaveEqualLength() const;
88  // \brief get number of sequences
89  int GetCount() const;
90  SequenceHandle operator[](int index) const;
91  Iterator Begin() const;
92  Iterator End() const;
93 
97  SequenceList Take(int n) const;
98 
100  SequenceList Slice(int first, int n) const;
101  // for stl compat
102  Iterator begin() const { return Begin(); }
103  Iterator end() const { return End(); }
104 
105  bool IsValid() const;
106 
107  int GetMinLength() const;
108  int GetMaxLength() const;
109 
110  // \internal
111  impl::SequenceListImplPtr& Impl() const;
113 
114  operator ConstSequenceList() const;
115 protected:
116  void CheckValidity() const;
117 
119 };
120 
123 
126  info::InfoGroup& group);
127 
130 }}
131 
132 #endif