zeek/testing/btest/plugins/reader-plugin/src/Foo.h
Benjamin Bannier f5a76c1aed Reformat Zeek in Spicy style
This largely copies over Spicy's `.clang-format` configuration file. The
one place where we deviate is header include order since Zeek depends on
headers being included in a certain order.
2023-10-30 09:40:55 +01:00

32 lines
962 B
C++

#pragma once
#include "input/ReaderBackend.h"
#include "threading/formatters/Ascii.h"
namespace btest::input::reader {
/**
* A Foo reader to measure performance of the input framework.
*/
class Foo : public zeek::input::ReaderBackend {
public:
Foo(zeek::input::ReaderFrontend* frontend);
~Foo();
static zeek::input::ReaderBackend* Instantiate(zeek::input::ReaderFrontend* frontend) { return new Foo(frontend); }
protected:
virtual bool DoInit(const zeek::input::ReaderBackend::ReaderInfo& info, int arg_num_fields,
const zeek::threading::Field* const* fields);
virtual void DoClose();
virtual bool DoUpdate();
virtual bool DoHeartbeat(double network_time, double current_time);
private:
std::string RandomString(const int len);
zeek::threading::Value* EntryToVal(zeek::TypeTag Type, zeek::TypeTag subtype);
zeek::threading::formatter::Ascii* ascii;
};
} // namespace btest::input::reader