-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDetectorStrategy.h
45 lines (33 loc) · 917 Bytes
/
DetectorStrategy.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* DetectorStrategy.h
*
* Created on: 04.12.2017
* Author: nid
*/
#ifndef LIB_BUTTON_DETECTORSTRATEGY_H_
#define LIB_BUTTON_DETECTORSTRATEGY_H_
class Button;
class DetectorStrategy
{
public:
void doActionFilter(bool currentState, bool formerState);
void attachButton(Button* myButton);
Button* button();
virtual void notifyPeerStatusChanged(bool isActive) { }
protected:
DetectorStrategy();
virtual ~DetectorStrategy();
public:
void setNext(DetectorStrategy* next);
DetectorStrategy* next();
protected:
virtual void onRisingEdge() { }
virtual void onFallingEdge() { }
private:
DetectorStrategy* m_next;
Button* m_button;
private: // forbidden functions
DetectorStrategy(const DetectorStrategy& src); // copy constructor
DetectorStrategy& operator = (const DetectorStrategy& src); // assignment operator
};
#endif /* LIB_BUTTON_DETECTORSTRATEGY_H_ */