ANNA Suite  2020b
Multipurpose development suite for Telco applications
CommaSeparatedList.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7 
8 
9 #ifndef anna_core_util_CommaSeparatedList_hpp
10 #define anna_core_util_CommaSeparatedList_hpp
11 
12 namespace anna {
13 
61 template <typename T> class CommaSeparatedList {
62 public:
63  typedef typename std::vector <T*>::iterator iterator;
64  typedef typename std::vector <T*>::const_iterator const_iterator;
70 
74  ~CommaSeparatedList() { a_parameters.clear(); }
75 
82  CommaSeparatedList<T>& operator, (T& t) { a_parameters.push_back(&t); return *this; }
83 
90  CommaSeparatedList<T>& operator= (T& t) { a_parameters.push_back(&t); return *this; }
91 
98  if(this != &rsh)
99  a_parameters = rsh.parameters;
100 
101  return *this;
102  }
103 
107  void clear() { a_parameters.clear(); }
108 
113  iterator begin() { return a_parameters.begin(); }
114 
119  const_iterator begin() const { return a_parameters.begin(); }
120 
125  iterator end() { return a_parameters.end(); }
126 
131  const_iterator end() const { return a_parameters.end(); }
132 
137  static T* data(iterator& ii) { return *ii; }
138 
143  static const T* data(const_iterator& ii) { return *ii; }
144 
145 private:
146  std::vector <T*> a_parameters;
147 };
148 
149 }
150 
151 #endif
152 
void clear()
Definition: CommaSeparatedList.hpp:107
CommaSeparatedList()
Definition: CommaSeparatedList.hpp:69
static T * data(iterator &ii)
Definition: CommaSeparatedList.hpp:137
std::vector< T * >::const_iterator const_iterator
Definition: CommaSeparatedList.hpp:64
const_iterator begin() const
Definition: CommaSeparatedList.hpp:119
iterator end()
Definition: CommaSeparatedList.hpp:125
~CommaSeparatedList()
Definition: CommaSeparatedList.hpp:74
static const T * data(const_iterator &ii)
Definition: CommaSeparatedList.hpp:143
std::vector< T * >::iterator iterator
Definition: CommaSeparatedList.hpp:63
CommaSeparatedList< T > & operator=(T &t)
Definition: CommaSeparatedList.hpp:90
Definition: app.hpp:12
const_iterator end() const
Definition: CommaSeparatedList.hpp:131
CommaSeparatedList< T > & operator,(T &t)
Definition: CommaSeparatedList.hpp:82
Definition: CommaSeparatedList.hpp:61
iterator begin()
Definition: CommaSeparatedList.hpp:113