Array.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*****************************************************************************
  2. Array.h
  3. By Laurent de Soras
  4. --- Legal stuff ---
  5. This program is free software. It comes without any warranty, to
  6. the extent permitted by applicable law. You can redistribute it
  7. and/or modify it under the terms of the Do What The Fuck You Want
  8. To Public License, Version 2, as published by Sam Hocevar. See
  9. http://sam.zoy.org/wtfpl/COPYING for more details.
  10. *Tab=3***********************************************************************/
  11. #if ! defined (ffft_Array_HEADER_INCLUDED)
  12. #define ffft_Array_HEADER_INCLUDED
  13. #if defined (_MSC_VER)
  14. #pragma once
  15. #pragma warning (4 : 4250) // "Inherits via dominance."
  16. #endif
  17. /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
  18. namespace ffft
  19. {
  20. template <class T, long LEN>
  21. class Array
  22. {
  23. /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
  24. public:
  25. typedef T DataType;
  26. Array ();
  27. inline const DataType &
  28. operator [] (long pos) const;
  29. inline DataType &
  30. operator [] (long pos);
  31. static inline long
  32. size ();
  33. /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
  34. protected:
  35. /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
  36. private:
  37. DataType _data_arr [LEN];
  38. /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
  39. private:
  40. Array (const Array &other);
  41. Array & operator = (const Array &other);
  42. bool operator == (const Array &other);
  43. bool operator != (const Array &other);
  44. }; // class Array
  45. } // namespace ffft
  46. #include "ffft/Array.hpp"
  47. #endif // ffft_Array_HEADER_INCLUDED
  48. /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/