BogaudioModules

BogaudioModules for VCV Rack
Log | Files | Refs | README | LICENSE

DynArray.h (2031B)


      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 
     17 
     18 #if ! defined (ffft_DynArray_HEADER_INCLUDED)
     19 #define	ffft_DynArray_HEADER_INCLUDED
     20 
     21 #if defined (_MSC_VER)
     22 	#pragma once
     23 	#pragma warning (4 : 4250) // "Inherits via dominance."
     24 #endif
     25 
     26 
     27 
     28 /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     29 
     30 
     31 
     32 namespace ffft
     33 {
     34 
     35 
     36 
     37 template <class T>
     38 class DynArray
     39 {
     40 
     41 /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     42 
     43 public:
     44 
     45 	typedef	T	DataType;
     46 
     47 						DynArray ();
     48 	explicit			DynArray (long size);
     49 						~DynArray ();
     50 
     51 	inline long		size () const;
     52 	inline void		resize (long size);
     53 
     54 	inline const DataType &
     55 						operator [] (long pos) const;
     56 	inline DataType &
     57 						operator [] (long pos);
     58 
     59 
     60 
     61 /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     62 
     63 protected:
     64 
     65 
     66 
     67 /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     68 
     69 private:
     70 
     71 	DataType *		_data_ptr;
     72 	long				_len;
     73 
     74 
     75 
     76 /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     77 
     78 private:
     79 
     80 						DynArray (const DynArray &other);
     81 	DynArray &		operator = (const DynArray &other);
     82 	bool				operator == (const DynArray &other);
     83 	bool				operator != (const DynArray &other);
     84 
     85 };	// class DynArray
     86 
     87 
     88 
     89 }	// namespace ffft
     90 
     91 
     92 
     93 #include	"ffft/DynArray.hpp"
     94 
     95 
     96 
     97 #endif	// ffft_DynArray_HEADER_INCLUDED
     98 
     99 
    100 
    101 /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/