dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
DynArray.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  DynArray.h
4  By Laurent de Soras
5 
6 --- Legal stuff ---
7 
8 This program is free software. It comes without any warranty, to
9 the extent permitted by applicable law. You can redistribute it
10 and/or modify it under the terms of the Do What The Fuck You Want
11 To Public License, Version 2, as published by Sam Hocevar. See
12 http://sam.zoy.org/wtfpl/COPYING for more details.
13 
14 *Tab=3***********************************************************************/
15 
16 #if !defined(ffft_DynArray_HEADER_INCLUDED)
17 #define ffft_DynArray_HEADER_INCLUDED
18 
19 #if defined(_MSC_VER)
20 #pragma once
21 #pragma warning(4 : 4250) // "Inherits via dominance."
22 #endif
23 
24 /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
25 
26 namespace ffft {
27 
28 template <class T>
29 class DynArray
30 {
31 
32  /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
33 
34 public:
35  typedef T DataType;
36 
37  DynArray();
38  explicit DynArray(long size);
39  ~DynArray();
40 
41  inline long size() const;
42  inline void resize(long size);
43 
44  inline const DataType &operator[](long pos) const;
45  inline DataType &operator[](long pos);
46 
47  /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
48 
49 protected:
50  /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
51 
52 private:
53  DataType *_data_ptr;
54  long _len;
55 
56  /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
57 
58 private:
59  DynArray(const DynArray &other);
60  DynArray &operator=(const DynArray &other);
61  bool operator==(const DynArray &other);
62  bool operator!=(const DynArray &other);
63 
64 }; // class DynArray
65 
66 } // namespace ffft
67 
68 #include "DynArray.hpp"
69 
70 #endif // ffft_DynArray_HEADER_INCLUDED
71 
72 /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
long size() const
Definition: DynArray.hpp:79
const DataType & operator[](long pos) const
Definition: DynArray.hpp:105
void resize(long size)
Definition: DynArray.hpp:87