BogaudioModules

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

Array.hpp (1945B)


      1 /*****************************************************************************
      2 
      3         Array.hpp
      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_Array_CURRENT_CODEHEADER)
     19 	#error Recursive inclusion of Array code header.
     20 #endif
     21 #define	ffft_Array_CURRENT_CODEHEADER
     22 
     23 #if ! defined (ffft_Array_CODEHEADER_INCLUDED)
     24 #define	ffft_Array_CODEHEADER_INCLUDED
     25 
     26 
     27 
     28 /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     29 
     30 #include	<cassert>
     31 
     32 
     33 
     34 namespace ffft
     35 {
     36 
     37 
     38 
     39 /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     40 
     41 
     42 
     43 template <class T, long LEN>
     44 Array <T, LEN>::Array ()
     45 {
     46 	// Nothing
     47 }
     48 
     49 
     50 
     51 template <class T, long LEN>
     52 const typename Array <T, LEN>::DataType &	Array <T, LEN>::operator [] (long pos) const
     53 {
     54 	assert (pos >= 0);
     55 	assert (pos < LEN);
     56 
     57 	return (_data_arr [pos]);
     58 }
     59 
     60 
     61 
     62 template <class T, long LEN>
     63 typename Array <T, LEN>::DataType &	Array <T, LEN>::operator [] (long pos)
     64 {
     65 	assert (pos >= 0);
     66 	assert (pos < LEN);
     67 
     68 	return (_data_arr [pos]);
     69 }
     70 
     71 
     72 
     73 template <class T, long LEN>
     74 long	Array <T, LEN>::size ()
     75 {
     76 	return (LEN);
     77 }
     78 
     79 
     80 
     81 /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     82 
     83 
     84 
     85 /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     86 
     87 
     88 
     89 }	// namespace ffft
     90 
     91 
     92 
     93 #endif	// ffft_Array_CODEHEADER_INCLUDED
     94 
     95 #undef ffft_Array_CURRENT_CODEHEADER
     96 
     97 
     98 
     99 /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/