blob: d088edafd33b3e62c00fad57c9d674eb40c5b38a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "generator.h"
#include "request.h"
#include <vbench/core/input_file_reader.h>
#include <vbench/core/handler.h>
namespace vbench {
/**
* Reads lines from an input file and generates requests that are
* passed to a request handler.
**/
class RequestGenerator : public Generator
{
private:
InputFileReader _input;
Handler<Request> &_next;
bool _aborted;
public:
RequestGenerator(const string &inputFile, Handler<Request> &next);
void abort() override;
void run() override;
const Taint &tainted() const override { return _input.tainted(); }
};
} // namespace vbench
|