14#include <boost/date_time/posix_time/posix_time.hpp>
40 Alarm(uint16_t family, uint8_t query_type, uint8_t response_type,
41 const std::string& start_event_label,
const std::string& stop_event_label,
109 return (last_high_water_report_);
119 last_high_water_report_ = timestamp;
static boost::posix_time::ptime now()
Fetch the current UTC system time, microsecond precision.
Defines an alarm for a duration.
void setHighWater(const Duration &high_water)
Set the high water threshold.
Timestamp getLastHighWaterReport()
Get the timestamp of the last high water report.
void clear()
Sets the alarm back to the CLEAR state.
void setState(State state)
Sets the alarm state.
virtual ~Alarm()=default
Destructor.
void setLastHighWaterReport(const Timestamp ×tamp=dhcp::PktEvent::now())
Set the timestamp of the last high water report.
bool checkSample(const Duration &sample, const Duration &report_interval)
Checks a duration against the high and low water thresholds and calls the appropriate event handler.
void disable()
Disables the alarm by setting the state to DISABLED.
Duration getHighWater() const
Get the high water threshold.
void setLowWater(const Duration &low_water)
Set the low water threshold.
Alarm(uint16_t family, uint8_t query_type, uint8_t response_type, const std::string &start_event_label, const std::string &stop_event_label, dhcp::SubnetID subnet_id, const Duration &low_water, const Duration &high_water, bool enabled=true)
Constructor.
State getState()
Get the alarm's state.
State
Defines Alarm states.
Timestamp getStosTime()
Get the time the current state began.
Duration getLowWater() const
Get the low water threshold.
Houses the composite key that uniquely identifies a duration:
Defines a State within the State Model.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
boost::posix_time::time_duration Duration
boost::posix_time::ptime Timestamp
boost::shared_ptr< Alarm > AlarmPtr
Defines a pointer to an Alarm instance.
Defines the logger used by the top-level component of kea-lfc.