dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
OscSinCos.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  OscSinCos.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 #if !defined(ffft_OscSinCos_HEADER_INCLUDED)
17 #define ffft_OscSinCos_HEADER_INCLUDED
18 
19 #if defined(_MSC_VER)
20 #pragma once
21 #pragma warning(4 : 4250) // "Inherits via dominance."
22 #endif
23 
24 /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
25 
26 #include "def.h"
27 
28 namespace ffft {
29 
30 template <class T>
31 class OscSinCos
32 {
33 
34  /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
35 
36 public:
37  typedef T DataType;
38 
39  OscSinCos();
40 
41  ffft_FORCEINLINE void set_step(double angle_rad);
42 
43  ffft_FORCEINLINE DataType get_cos() const;
44  ffft_FORCEINLINE DataType get_sin() const;
45  ffft_FORCEINLINE void step();
46  ffft_FORCEINLINE void clear_buffers();
47 
48  /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
49 
50 protected:
51  /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
52 
53 private:
54  DataType _pos_cos; // Current phase expressed with sin and cos. [-1 ; 1]
55  DataType _pos_sin; // -
56  DataType _step_cos; // Phase increment per step, [-1 ; 1]
57  DataType _step_sin; // -
58 
59  /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
60 
61 private:
62  OscSinCos(const OscSinCos &other);
63  OscSinCos &operator=(const OscSinCos &other);
64  bool operator==(const OscSinCos &other);
65  bool operator!=(const OscSinCos &other);
66 
67 }; // class OscSinCos
68 
69 } // namespace ffft
70 
71 #include "OscSinCos.hpp"
72 
73 #endif // ffft_OscSinCos_HEADER_INCLUDED
74 
75 /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
ffft_FORCEINLINE void step()
Definition: OscSinCos.hpp:85
ffft_FORCEINLINE void clear_buffers()
Definition: OscSinCos.hpp:97
ffft_FORCEINLINE DataType get_cos() const
Definition: OscSinCos.hpp:69
ffft_FORCEINLINE DataType get_sin() const
Definition: OscSinCos.hpp:77
ffft_FORCEINLINE void set_step(double angle_rad)
Definition: OscSinCos.hpp:58