eis/TestProject/play_gruond/HoldTime.h

30 lines
708 B
C
Raw Normal View History

#pragma once
#include <chrono>
#include <cmath>
#include <limits>
#include <string>
#include <tuple>
class HoldTime {
public:
HoldTime(double time);
~HoldTime();
/**
* @brief
* @param exp_str My Param doc
* @return std::tuple<bool, double, std::string, std::string>
* tagi
*/
static std::tuple<bool, double, std::string, std::string> find_hold(
std::string exp_str);
public:
void update_value(double tag_value);
inline operator bool(void) const { return value; }
inline bool get_value(void) const { return value; }
private:
double last_value;
double hold_time;
bool value;
std::chrono::system_clock::time_point last_time;
};