1/*****************************************************************************
2
3 DynArray.h
4 Copyright (c) 2005 Laurent de Soras
5
6--- Legal stuff ---
7
8This library is free software; you can redistribute it and/or
9modify it under the terms of the GNU Lesser General Public
10License as published by the Free Software Foundation; either
11version 2.1 of the License, or (at your option) any later version.
12
13This library is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16Lesser General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public
19License along with this library; if not, write to the Free Software
20Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22*Tab=3***********************************************************************/
23
24
25
26#if ! defined (DynArray_HEADER_INCLUDED)
27#define DynArray_HEADER_INCLUDED
28
29#if defined (_MSC_VER)
30 #pragma once
31 #pragma warning (4 : 4250) // "Inherits via dominance."
32#endif
33
34
35
36/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
37
38
39
40template <class T>
41class DynArray
42{
43
44/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
45
46public:
47
48 typedef T DataType;
49
50 DynArray ();
51 explicit DynArray (long size);
52 ~DynArray ();
53
54 inline long size () const;
55 inline void resize (long size);
56
57 inline const DataType &
58 operator [] (long pos) const;
59 inline DataType &
60 operator [] (long pos);
61
62
63
64/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
65
66protected:
67
68
69
70/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
71
72private:
73
74 DataType * _data_ptr;
75 long _len;
76
77
78
79/*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
80
81private:
82
83 DynArray (const DynArray &other);
84 DynArray & operator = (const DynArray &other);
85 bool operator == (const DynArray &other);
86 bool operator != (const DynArray &other);
87
88}; // class DynArray
89
90
91
92#include "DynArray.hpp"
93
94
95
96#endif // DynArray_HEADER_INCLUDED
97
98
99
100/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
101

source code of qtmultimedia/examples/multimedia/spectrum/3rdparty/fftreal/DynArray.h