clockUtils  1.1
ArgumentList.h
Go to the documentation of this file.
1 /*
2  * clockUtils
3  * Copyright (2015) Michael Baer, Daniel Bonrath, All rights reserved.
4  *
5  * This file is part of clockUtils; clockUtils is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
25 #ifndef __CLOCKUTILS_ARGPARSER_ARGUMENTLIST_H__
26 #define __CLOCKUTILS_ARGPARSER_ARGUMENTLIST_H__
27 
29 
30 #include <string>
31 #include <vector>
32 
33 namespace clockUtils {
34 namespace argParser {
35 
36  class Parser;
37 
42  friend class Parser;
43 
44  public:
45  typedef std::vector<std::string>::iterator iterator;
46  typedef std::vector<std::string>::const_iterator const_iterator;
47  typedef std::vector<std::string>::reverse_iterator reverse_iterator;
48  typedef std::vector<std::string>::const_reverse_iterator const_reverse_iterator;
49  typedef std::vector<std::string>::reference reference;
50  typedef std::vector<std::string>::const_reference const_reference;
51  typedef std::vector<std::string>::size_type size_type;
52 
56  ArgumentList();
57 
61  ~ArgumentList();
62 
66  iterator begin() {
67  return _vec.begin();
68  }
69 
70  const_iterator begin() const {
71  return _vec.begin();
72  }
73 
74  iterator end() {
75  return _vec.end();
76  }
77 
78  const_iterator end() const {
79  return _vec.end();
80  }
81 
82  reverse_iterator rbegin() {
83  return _vec.rbegin();
84  }
85 
86  const_reverse_iterator rbegin() const {
87  return _vec.rbegin();
88  }
89 
90  reverse_iterator rend() {
91  return _vec.rend();
92  }
93 
94  const_reverse_iterator rend() const {
95  return _vec.rend();
96  }
97 
98  const_iterator cbegin() const {
99  return _vec.cbegin();
100  }
101 
102  const_iterator cend() const {
103  return _vec.cend();
104  }
105 
106  const_reverse_iterator crbegin() const {
107  return _vec.crbegin();
108  }
109 
110  const_reverse_iterator crend() const {
111  return _vec.crend();
112  }
113 
114  size_t size() const {
115  return _vec.size();
116  }
117 
118  bool empty() const {
119  return _vec.empty();
120  }
121 
122  reference operator[](size_type n) {
123  return _vec[n];
124  }
125 
126  const_reference operator[](size_type n) const {
127  return _vec[n];
128  }
129 
130  reference at(size_type n) {
131  return _vec.at(n);
132  }
133 
134  const_reference at(size_type n) const {
135  return _vec.at(n);
136  }
137 
138  reference front() {
139  return _vec.front();
140  }
141 
142  const_reference front() const {
143  return _vec.front();
144  }
145 
146  reference back() {
147  return _vec.back();
148  }
149 
150  const_reference back() const {
151  return _vec.back();
152  }
153 
154  private:
158  std::vector<std::string> _vec;
159  };
160 
161 } /* namespace argParser */
162 } /* namespace clockUtils */
163 
164 #endif /* __CLOCKUTILS_ARGPARSER_ARGUMENTLIST_H__ */
165 
const_reference operator[](size_type n) const
Definition: ArgumentList.h:126
#define CLOCK_ARGPARSER_API
std::vector< std::string >::reference reference
Definition: ArgumentList.h:49
const_iterator begin() const
Definition: ArgumentList.h:70
const_reverse_iterator rend() const
Definition: ArgumentList.h:94
const_reverse_iterator crend() const
Definition: ArgumentList.h:110
const_reference back() const
Definition: ArgumentList.h:150
const_iterator end() const
Definition: ArgumentList.h:78
std::vector< std::string >::const_iterator const_iterator
Definition: ArgumentList.h:46
std::vector< std::string >::iterator iterator
Definition: ArgumentList.h:45
iterator begin()
all following methods are just wrappers for std::vector
Definition: ArgumentList.h:66
const_reference at(size_type n) const
Definition: ArgumentList.h:134
std::vector< std::string >::size_type size_type
Definition: ArgumentList.h:51
const_reverse_iterator rbegin() const
Definition: ArgumentList.h:86
const_reverse_iterator crbegin() const
Definition: ArgumentList.h:106
std::vector< std::string >::const_reference const_reference
Definition: ArgumentList.h:50
const_reference front() const
Definition: ArgumentList.h:142
std::vector< std::string >::const_reverse_iterator const_reverse_iterator
Definition: ArgumentList.h:48
class handling all known variables being able to be parsed and offering parse functionality ...
Definition: Parser.h:43
const_iterator cbegin() const
Definition: ArgumentList.h:98
base class for Variable handling
Definition: ArgumentList.h:41
reference operator[](size_type n)
Definition: ArgumentList.h:122
std::vector< std::string >::reverse_iterator reverse_iterator
Definition: ArgumentList.h:47