zeek/src/file_analysis/FileTimer.h
Johanna Amann 876c803d75 Merge remote-tracking branch 'origin/topic/timw/776-using-statements'
* origin/topic/timw/776-using-statements:
  Remove 'using namespace std' from SerialTypes.h
  Remove other using statements from headers
  GH-776: Remove using statements added by PR 770

Includes small fixes in files that changed since the merge request was
made.

Also includes a few small indentation fixes.
2020-04-09 13:31:07 -07:00

36 lines
981 B
C++

// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include <string>
#include "Timer.h"
namespace file_analysis {
/**
* Timer to periodically check if file analysis for a given file is inactive.
*/
class FileTimer final : public Timer {
public:
/**
* Constructor, nothing interesting about it.
* @param t unix time at which the timer should start ticking.
* @param id the file identifier which will be checked for inactivity.
* @param interval amount of time after \a t to check for inactivity.
*/
FileTimer(double t, const std::string& id, double interval);
/**
* Check inactivity of file_analysis::File corresponding to #file_id,
* reschedule if active, else call file_analysis::Manager::Timeout.
* @param t current unix time
* @param is_expire true if all pending timers are being expired.
*/
void Dispatch(double t, bool is_expire) override;
private:
std::string file_id;
};
} // namespace file_analysis