PerfSensorBase.h 872 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
/*
 * PerfSensorBase.h
 *
 *  Created on: 09.08.2018
 *      Author: Micha Mueller
 */

#ifndef PERFEVENT_PERFSENSORBASE_H_
#define PERFEVENT_PERFSENSORBASE_H_

11
#include "../../includes/SensorBase.h"
12
13
#include <limits.h>

14
15
class PerfSensorBase : virtual public SensorBase {
public:
16
	static constexpr int64_t MAXCOUNTERVALUE = LLONG_MAX; //ToDo check if it is not LLONG_MAX, or make it configurable!
17

18
19
20
	PerfSensorBase(const std::string& name) :
		SensorBase(name),
		_type(0),
21
		_config(0) {}
22
23
24
25
26
27
28
29

	virtual ~PerfSensorBase() {}

	unsigned getType() 		const { return _type; }
	unsigned getConfig()	const { return _config; }

	void setType(unsigned type)		{ _type = type; }
	void setConfig(unsigned config)	{ _config = config;	}
30

31
32
33
34
35
protected:
	unsigned int _type;
	unsigned int _config;
};

36
37
using PerfSBPtr = std::shared_ptr<PerfSensorBase>;

38
#endif /* PERFEVENT_PERFSENSORBASE_H_ */