Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ResultDataHandler.h
Go to the documentation of this file.
1#pragma once
3#include <misc/gen/Range.h>
4
5namespace sf
6{
7
12{
13 public:
17 virtual void resultDataEventHandler(ResultDataTypes::EEvent event, const ResultData& caller, ResultData& link, const Range& range, bool sameInst) = 0;
18
25
26 friend class ResultDataTypes;
27
28 friend class ResultData;
29};
30
31template<typename T>
33{
34 public:
38 typedef void (T::*TPmf)(EEvent event, const ResultData& caller, ResultData& link, const Range& rng, bool sameInst);
39
45 inline TResultDataHandler(T* _this, TPmf pmf)
46 : _self(_this)
47 , _pmf(pmf)
48 {}
49
54
59
60 private:
64 TPmf _pmf;
68 T* _self;
69
73 void resultDataEventHandler(EEvent event, const ResultData& caller, ResultData& link, const Range& rng, bool same_inst) override
74 {
75 (_self->*_pmf)(event, caller, link, rng, same_inst);
76 }
77};
78
79}// namespace sf
Class to manage 64-bit integer ranges.
Definition Range.h:52
Class used to give a ResultData instance access to virtual method of a derived class.
Definition ResultDataHandler.h:12
virtual void resultDataEventHandler(ResultDataTypes::EEvent event, const ResultData &caller, ResultData &link, const Range &range, bool sameInst)=0
Pure virtual function which must be overloaded in a derived class.
virtual ~ResultDataHandler()
Destructor.
This base class contains all local types of used in the sf::ResultData class. Multiple inheritance m...
Definition ResultDataTypes.h:25
EEvent
Event enumerate values used in broadcasting where global events have a negative value.
Definition ResultDataTypes.h:46
Class for creating and referencing global created data called result data. This class allows linking ...
Definition ResultData.h:20
Definition ResultDataHandler.h:33
TResultDataHandler(T *_this, TPmf pmf)
One and only template constructor.
Definition ResultDataHandler.h:45
TResultDataHandler & operator=(const ResultDataHandler &)=delete
Prevent assignment.
void(T::* TPmf)(EEvent event, const ResultData &caller, ResultData &link, const Range &rng, bool sameInst)
Required event handler type.
Definition ResultDataHandler.h:38
TResultDataHandler(const TResultDataHandler &)=delete
Prevent copying.
#define _GII_CLASS
Definition gii/global.h:38
Definition Application.h:10