JS8Call-Improved master
Loading...
Searching...
No Matches
Flatten.h
1#ifndef FLATTEN_HPP__
2#define FLATTEN_HPP__
3
4#include <memory>
5
6// Functor by which to flatten (or not, by default) a spectrum; not
7// reentrant, but serially reusable.
8
9class Flatten {
10 public:
11 // Constructor
12 explicit Flatten(bool = false);
13
14 // Destructor
15 ~Flatten();
16
17 // Turn flattening on or off
18 void operator()(bool value);
19
20 // Process (or not) the supplied spectrum data
21 void operator()(float *data, std::size_t size);
22
23 // Return active / inactive flattening status
24 explicit operator bool() const noexcept { return !!m_impl; }
25 bool live() const noexcept { return !!m_impl; }
26
27 private:
28 class Impl;
29 std::unique_ptr<Impl> m_impl;
30};
31
32#endif
Definition Flatten.cpp:140