Lumiera  0.pre.03
»edit your freedom«
ref-array.hpp
Go to the documentation of this file.
1 /*
2  REF-ARRAY.hpp - abstraction providing array-like access to a list of references
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
31 #ifndef LIB_REF_ARRAY_H
32 #define LIB_REF_ARRAY_H
33 
34 
35 #include "lib/nocopy.hpp"
36 
37 
38 namespace lib {
39 
47  template<class T>
48  class RefArray
50  {
51  public:
52  virtual ~RefArray() {}
53 
54  virtual T const& operator[] (size_t i) const =0;
55  virtual size_t size() const =0;
56  };
57 
58 
59 } // namespace lib
60 #endif
Abstraction: Array of const references.
Definition: ref-array.hpp:48
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
Implementation namespace for support and library code.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
virtual ~RefArray()
this is an interface
Definition: ref-array.hpp:52