ENH: add module flush vol predictor

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ie1b0d4c443df4a26ff1b010e73d589162a0fbff7
(cherry picked from commit 475e9b34ff85cf6058ac639fde4b73264e350195)
This commit is contained in:
xun.zhang
2024-09-20 19:23:37 +08:00
committed by Noisyfox
parent a2ae7e1ddd
commit 179eab1355
6 changed files with 272 additions and 36 deletions

View File

@@ -0,0 +1,22 @@
#ifndef FLUSH_VOL_PREDICTOR_HPP
#define FLUSH_VOL_PREDICTOR_HPP
#include<unordered_map>
class FlushVolPredictor
{
public:
bool predict(const unsigned char src_r, const unsigned char src_g, const unsigned char src_b,
const unsigned char dst_r, const unsigned char dst_g, const unsigned char dst_b, float& flush);
static FlushVolPredictor& get_instance();
private:
FlushVolPredictor(const std::string& data_file);
FlushVolPredictor(const FlushVolPredictor&) = delete;
FlushVolPredictor& operator=(const FlushVolPredictor&) = delete;
~FlushVolPredictor() = default;
private:
std::unordered_map<uint64_t, float> m_flush_map;
bool m_valid;
};
#endif