aimsdata 6.0.0
Neuroimaging data handling
selection.h
Go to the documentation of this file.
1/* This software and supporting documentation are distributed by
2 * Institut Federatif de Recherche 49
3 * CEA/NeuroSpin, Batiment 145,
4 * 91191 Gif-sur-Yvette cedex
5 * France
6 *
7 * This software is governed by the CeCILL-B license under
8 * French law and abiding by the rules of distribution of free software.
9 * You can use, modify and/or redistribute the software under the
10 * terms of the CeCILL-B license as circulated by CEA, CNRS
11 * and INRIA at the following URL "http://www.cecill.info".
12 *
13 * As a counterpart to the access to the source code and rights to copy,
14 * modify and redistribute granted by the license, users are provided only
15 * with a limited warranty and the software's author, the holder of the
16 * economic rights, and the successive licensors have only limited
17 * liability.
18 *
19 * In this respect, the user's attention is drawn to the risks associated
20 * with loading, using, modifying and/or developing or reproducing the
21 * software by the user in light of its specific status of free software,
22 * that may mean that it is complicated to manipulate, and that also
23 * therefore means that it is reserved for developers and experienced
24 * professionals having in-depth computer knowledge. Users are therefore
25 * encouraged to load and test the software's suitability as regards their
26 * requirements in conditions enabling the security of their systems and/or
27 * data to be ensured and, more generally, to use and operate it in the
28 * same conditions as regards security.
29 *
30 * The fact that you are presently reading this means that you have had
31 * knowledge of the CeCILL-B license and that you accept its terms.
32 */
33
34#ifndef AIMS_SELECTION_SELECTION_H
35#define AIMS_SELECTION_SELECTION_H
36
37
38#include <string>
39#include <list>
40
41
42namespace aims
43{
44
46 {
47 public:
48 typedef std::list<std::string>::value_type value_type;
49 typedef std::list<std::string>::pointer pointer;
50 typedef std::list<std::string>::const_pointer const_pointer;
51 typedef std::list<std::string>::reference reference;
52 typedef std::list<std::string>::const_reference const_reference;
53
54 typedef std::list<std::string>::difference_type difference_type;
55 typedef std::list<std::string>::size_type size_type;
56
57 typedef std::list<std::string>::iterator iterator;
58 typedef std::list<std::string>::const_iterator const_iterator;
59 typedef std::list<std::string>::reverse_iterator reverse_iterator;
60 typedef std::list<std::string>::const_reverse_iterator
62
64 iterator end();
65 const_iterator begin() const;
66 const_iterator end() const;
71
73 Selection( const std::string & selname );
74 void select( const std::string& label );
75 void selectQuick( const std::string& label );
76 void unselect( const std::string& label );
77 iterator find( const std::string & label );
78 const_iterator find( const std::string & label ) const;
79 bool empty() const;
80 std::string name() const;
81
82 private:
83 std::list<std::string> my_labels;
84 std::string my_name;
85 };
86
87
89 {
90 public:
91 typedef std::list<Selection>::value_type value_type;
92 typedef std::list<Selection>::pointer pointer;
93 typedef std::list<Selection>::const_pointer const_pointer;
94 typedef std::list<Selection>::reference reference;
95 typedef std::list<Selection>::const_reference const_reference;
96
97 typedef std::list<Selection>::difference_type difference_type;
98 typedef std::list<Selection>::size_type size_type;
99
100 typedef std::list<Selection>::iterator iterator;
101 typedef std::list<Selection>::const_iterator const_iterator;
102 typedef std::list<Selection>::reverse_iterator reverse_iterator;
103 typedef std::list<Selection>::const_reverse_iterator
105
106 iterator begin();
107 iterator end();
108 const_iterator begin() const;
109 const_iterator end() const;
114
115 void addSelection( const Selection& selection, bool enabledups = false );
118 void load( const std::string & filename );
119 void append( const std::string & filename );
120 void save( const std::string & filename ) const;
123 iterator findSelection( const std::string & );
124 const_iterator findSelection( const std::string & ) const;
125 bool empty() const;
126
127 private:
128 std::list<Selection> my_selections;
129 };
130
131
132} // namespace aims
133
134
135inline
137{
138 return my_labels.begin();
139}
140
141
142inline
144{
145 return my_labels.end();
146}
147
148
149inline
151{
152 return my_labels.begin();
153}
154
155
156inline
158{
159 return my_labels.end();
160}
161
162
163inline
165{
166 return my_labels.rbegin();
167}
168
169
170inline
172{
173 return my_labels.rend();
174}
175
176
177inline
179{
180 return my_labels.rbegin();
181}
182
183
184inline
186{
187 return my_labels.rend();
188}
189
190
191inline
193{
194 return my_selections.begin();
195}
196
197
198inline
200{
201 return my_selections.end();
202}
203
204
205inline
207{
208 return my_selections.begin();
209}
210
211
212inline
214{
215 return my_selections.end();
216}
217
218
219inline
221{
222 return my_selections.rbegin();
223}
224
225
226inline
228{
229 return my_selections.rend();
230}
231
232
233inline
235{
236 return my_selections.rbegin();
237}
238
239
240inline
242{
243 return my_selections.rend();
244}
245
246
247#endif
std::list< Selection >::size_type size_type
Definition selection.h:98
void deleteSelection(Selection *)
std::list< Selection >::reverse_iterator reverse_iterator
Definition selection.h:102
const_iterator findSelection(const std::string &) const
bool empty() const
void load(const std::string &filename)
std::list< Selection >::difference_type difference_type
Definition selection.h:97
void save(const std::string &filename) const
reverse_iterator rbegin()
Definition selection.h:220
std::list< Selection >::iterator iterator
Definition selection.h:100
void deleteSelection(iterator i)
void addSelection(const Selection &selection, bool enabledups=false)
iterator findSelection(const std::string &)
reverse_iterator rend()
Definition selection.h:227
iterator begin()
Definition selection.h:192
std::list< Selection >::const_reference const_reference
Definition selection.h:95
const_iterator findSelection(const Selection &) const
std::list< Selection >::pointer pointer
Definition selection.h:92
void append(const std::string &filename)
std::list< Selection >::const_reverse_iterator const_reverse_iterator
Definition selection.h:104
std::list< Selection >::const_pointer const_pointer
Definition selection.h:93
std::list< Selection >::value_type value_type
Definition selection.h:91
std::list< Selection >::reference reference
Definition selection.h:94
iterator findSelection(const Selection &)
std::list< Selection >::const_iterator const_iterator
Definition selection.h:101
bool empty() const
void unselect(const std::string &label)
std::list< std::string >::reference reference
Definition selection.h:51
reverse_iterator rbegin()
Definition selection.h:164
iterator find(const std::string &label)
std::string name() const
std::list< std::string >::value_type value_type
Definition selection.h:48
std::list< std::string >::const_reference const_reference
Definition selection.h:52
std::list< std::string >::const_iterator const_iterator
Definition selection.h:58
void select(const std::string &label)
void selectQuick(const std::string &label)
iterator begin()
Definition selection.h:136
std::list< std::string >::const_pointer const_pointer
Definition selection.h:50
Selection(const std::string &selname)
reverse_iterator rend()
Definition selection.h:171
std::list< std::string >::pointer pointer
Definition selection.h:49
std::list< std::string >::size_type size_type
Definition selection.h:55
std::list< std::string >::difference_type difference_type
Definition selection.h:54
std::list< std::string >::const_reverse_iterator const_reverse_iterator
Definition selection.h:61
iterator end()
Definition selection.h:143
const_iterator find(const std::string &label) const
std::list< std::string >::iterator iterator
Definition selection.h:57
std::list< std::string >::reverse_iterator reverse_iterator
Definition selection.h:59
The class for EcatSino data write operation.