forked from cpv-project/live-profiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BaseAnalyzer.hpp
30 lines (26 loc) · 937 Bytes
/
BaseAnalyzer.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once
#include <memory>
#include <vector>
namespace LiveProfiler {
/**
* The base class for the analyzer
*
* Terms:
* - The analyzer should be able to reset the state to it's initial state
* - The analyzer should be able to receive performance data at any time
* - The analyzer should provide a function named `getResult`, this function can return any type
* - The analysis of performance data can be done in real time, or at the time of `getResult`
* - The analyzer should not know there is a class called Profiler
*/
template <class Model>
class BaseAnalyzer :
public std::enable_shared_from_this<BaseAnalyzer<Model>> {
public:
/** Reset the state to it's initial state */
virtual void reset() = 0;
/** Receive performance data */
virtual void feed(const std::vector<std::unique_ptr<Model>>& models) = 0;
/** Base destructor should be virtual */
virtual ~BaseAnalyzer() = default;
};
}