TesterOperator.h 2.42 KB
Newer Older
1
//================================================================================
2
// Name        : TesterOperator.h
3
// Author      : Alessio Netti
Micha Müller's avatar
Micha Müller committed
4
// Contact     : info@dcdb.it
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright   : Leibniz Supercomputing Centre
// Description :
//================================================================================

//================================================================================
// This file is part of DCDB (DataCenter DataBase)
// Copyright (C) 2019-2019 Leibniz Supercomputing Centre
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
//================================================================================

28
29
#ifndef PROJECT_TESTEROPERATOR_H
#define PROJECT_TESTEROPERATOR_H
30

31
#include "../../includes/OperatorTemplate.h"
32
33
34
35
36
#include "sensorbase.h"

#define TESTERAN_OFFSET 1000000000

/**
37
 * @brief Tester operator plugin.
38
 *
39
 * @ingroup testeroperator
40
 */
41
class TesterOperator : virtual public OperatorTemplate<SensorBase> {
42
43
44

public:

45
46
    TesterOperator(const std::string& name);
    TesterOperator(const TesterOperator& other);
47
    
48
    virtual ~TesterOperator();
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

    void setWindow(unsigned long long w)        { _window = w; }
    void setNumQueries(unsigned long long q)    { _numQueries = q;}
    void setRelative(bool r)                    { _relative = r; }
    
    unsigned long long getWindow()              { return _window; }
    unsigned long long getNumQueries()          { return _numQueries; }
    bool getRelative()                          { return _relative; }
    
    void printConfig(LOG_LEVEL ll) override;

protected:

    virtual void compute(U_Ptr unit)	 override;
    
64
    vector<reading_t> _buffer;
65
66
67
68
69
70
    unsigned long long _window;
    unsigned long long _numQueries;
    bool _relative;
    
};

71
#endif //PROJECT_AGGREGATOROPERATOR_H