JASPL  0.2
Just Another Signal Processing Library
jalgorithm.h
1 #ifndef JALGORITHM_H
2 #define JALGORITHM_H
3 
4 //C System-Headers
5 //
6 //C++ System headers
7 #include <mutex>
8 //OpenCL Headers
9 //
10 // Boost Headers
11 #include <boost/thread/condition.hpp>
12 #include <boost/thread/mutex.hpp>
13 #include <boost/thread/thread.hpp>
14 #include <boost/circular_buffer.hpp>
15 #include <boost/lexical_cast.hpp>
16 //Project specific headers
17 #include "../JASPL/jTypeTraits/jtypetraits.h"
18 
19 namespace jaspl {
20 
21 template < typename T >
34 class RecurseMean {
35 
36  public:
37 
38  RecurseMean( uint num_samples );
39 
47  void operator()( const T& next_value );
48 
49  void Reset();
50  typename T::value_type Index();
51 
52  T ReturnValue();
53 
54  private:
55 
56  T last;
57  typename T::value_type index;
58  boost::shared_mutex monitor;
59 };
60 
61 
62 #include "../JASPL/jAlgorithm/jalgorithm.tpp"
63 
64 }
65 
66 #endif // JALGORITHM_H
Average together a (nearly) arbitrary number of container-like objects using the recursive definition...
Definition: jalgorithm.h:34
void operator()(const T &next_value)
Average together a new value.