Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
VariableCollector.h
Go to the documentation of this file.
1#pragma once
2
3#include <gii/gen/Variable.h>
4#include <map>
5#include <misc/gen/Sync.h>
7
8namespace sf
9{
10
12 : public VariableHandler
13 , protected Sync
14{
15 public:
17
19
20 void variableEventHandler(VariableTypes::EEvent event, const Variable& caller, Variable& link, bool same_inst) override;
21
22 private:
23 // Adds a variable to the map and links it.
24 void addVariable(const Variable& v);
25 // Holds the variable for listening to global events.
26 Variable _variable{};
27 // Maps a variable id to the variable instance pointer.
28 std::map<id_type, Variable*> _map{};
29
30 struct Data
31 {
32 enum
33 {
34 dtNone,
35 dtAdd,
36 dtRemove,
37 dtValue,
38 dtFlags
39 } _type{dtNone};
40 id_type _id{0};
41 Value _value{};
42 };
43 //
44 TFifoClass<Data> _fifo{1000};
45};
46
47}// namespace sf
unsigned long long id_type
Type used for the identifying integer (64-bits).
Definition InformationBase.h:30
Sync provides a system-independent interface to build classes that act like monitors,...
Definition Sync.h:56
Definition VariableCollector.h:14
~VariableCollector() override
void variableEventHandler(VariableTypes::EEvent event, const Variable &caller, Variable &link, bool same_inst) override
Pure virtual function which must be implemented when used in a polymorphic setting.
Base class used for giving a Variable instance access to a member functions of a derived class....
Definition VariableHandler.h:14
EEvent
Events send to the handler set with sf::Variable::setHandler.
Definition VariableTypes.h:130
Class for creating and referencing global or local created parameters or settings called variables....
Definition Variable.h:16
Definition Application.h:10