70 lines
1.8 KiB
C
Raw Normal View History

2021-10-09 15:16:34 -05:00
/*****************************************************************************
Array.h
By Laurent de Soras
--- Legal stuff ---
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.
*Tab=3***********************************************************************/
#if !defined(ffft_Array_HEADER_INCLUDED)
# define ffft_Array_HEADER_INCLUDED
2021-10-09 15:16:34 -05:00
# if defined(_MSC_VER)
# pragma once
# pragma warning(4 : 4250) // "Inherits via dominance."
# endif
2021-10-09 15:16:34 -05:00
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
namespace ffft
{
template<class T, long LEN>
2021-10-09 15:16:34 -05:00
class Array
{
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
2021-10-09 15:16:34 -05:00
public:
typedef T DataType;
2021-10-09 15:16:34 -05:00
Array();
2021-10-09 15:16:34 -05:00
inline const DataType &operator[](long pos) const;
inline DataType &operator[](long pos);
2021-10-09 15:16:34 -05:00
static inline long size();
2021-10-09 15:16:34 -05:00
/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
2021-10-09 15:16:34 -05:00
protected:
/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
2021-10-09 15:16:34 -05:00
private:
DataType _data_arr[LEN];
2021-10-09 15:16:34 -05:00
/*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
2021-10-09 15:16:34 -05:00
private:
Array(const Array &other);
Array &operator=(const Array &other);
bool operator==(const Array &other);
bool operator!=(const Array &other);
2021-10-09 15:16:34 -05:00
}; // class Array
2021-10-09 15:16:34 -05:00
} // namespace ffft
2021-10-09 15:16:34 -05:00
# include "Array.hpp"
2021-10-09 15:16:34 -05:00
#endif // ffft_Array_HEADER_INCLUDED
2021-10-09 15:16:34 -05:00
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/