Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
VariableTypes.h
Go to the documentation of this file.
1#pragma once
3#include <misc/gen/TVector.h>
4#include <misc/gen/Value.h>
5#include <utility>
6
7namespace sf
8{
9
13class VariableReference;
14
18class Variable;
19
26{
27 public:
32
37
42
46 class State
47 {
48 public:
53 : _name(Value::_invalidStr)
54 {}
55
59 State(std::string name, const Value& value)
60 : _name(std::move(name))
61 , _value(value)
62 {}
63
67 State(const State& s)
68 {
69 assign(s);
70 }
71
75 std::string _name;
80
84 State& assign(const State& s)
85 {
86 _name = s._name;
87 _value = s._value;
88 return *this;
89 }
90
95 {
96 assign(s);
97 return *this;
98 }
99
103 bool operator==(const State& state) const
104 {
105 return (_name == state._name) && (_value == state._value);
106 }
107
111 bool operator!=(const State& state) const
112 {
113 return (_name != state._name) || (_value != state._value);
114 }
115
120 };
121
170
205 {
209 flgReadonly = 1 << 0,
213 flgArchive = 1 << 1,
218 flgShare = 1 << 2,
222 flgLink = 1 << 3,
227 flgFunction = 1 << 4,
233 flgParameter = 1 << 5,
237 flgHidden = 1 << 6,
242 flgExport = 1 << 7,
247 flgWriteable = 1 << 8
248 };
249
268
331};
332
333}// namespace sf
Base class for all generic information objects to be able to put them in a typed list together.
Definition InformationBase.h:25
unsigned long long id_type
Type used for the identifying integer (64-bits).
Definition InformationBase.h:30
int32_t flags_type
Type used for the flag integer.
Definition InformationBase.h:34
Counted vector having additional methods and operators for ease of usage.
Definition TVector.h:25
Value container class able to performing arithmetic functions.
Definition Value.h:19
EType
Enumerate for available types.
Definition Value.h:34
Type containing a name referencing a value and is called a state.
Definition VariableTypes.h:47
State(std::string name, const Value &value)
Initialization constructor.
Definition VariableTypes.h:59
State & assign(const State &s)
Assignment function for save copying of the structure.
Definition VariableTypes.h:84
bool operator!=(const State &state) const
Compare unequal operator.
Definition VariableTypes.h:111
State(const State &s)
Copy constructor.
Definition VariableTypes.h:67
State()
Default constructor.
Definition VariableTypes.h:52
Value _value
Value which belongs to the name.
Definition VariableTypes.h:79
TVector< State > Vector
Vector class to be able to create a state list.
Definition VariableTypes.h:119
State & operator=(const State &s)
Assignment operator for save copying of the structure.
Definition VariableTypes.h:94
std::string _name
Name of the contained value.
Definition VariableTypes.h:75
bool operator==(const State &state) const
Compare equal operator.
Definition VariableTypes.h:103
This base class contains all local types of used in the Variable class. Multiple inheritance makes th...
Definition VariableTypes.h:26
EStringType
Enumeration of string types used for filtering.
Definition VariableTypes.h:254
@ stDirectory
Definition VariableTypes.h:262
@ stNormal
Definition VariableTypes.h:256
@ stFilename
Definition VariableTypes.h:264
@ stSubdirectory
Definition VariableTypes.h:266
@ stPath
Definition VariableTypes.h:260
@ stMulti
Definition VariableTypes.h:258
TVector< Variable * > PtrVector
Vector for pointers to variables.
Definition VariableTypes.h:31
EFlag
Enumeration type for specifying flags.
Definition VariableTypes.h:205
@ flgParameter
Definition VariableTypes.h:233
@ flgHidden
Definition VariableTypes.h:237
@ flgWriteable
Definition VariableTypes.h:247
@ flgArchive
Definition VariableTypes.h:213
@ flgShare
Definition VariableTypes.h:218
@ flgExport
Definition VariableTypes.h:242
@ flgLink
Definition VariableTypes.h:222
@ flgFunction
Definition VariableTypes.h:227
@ flgReadonly
Definition VariableTypes.h:209
EEvent
Events send to the handler set with sf::Variable::setHandler.
Definition VariableTypes.h:130
@ veLinked
Definition VariableTypes.h:162
@ veLostOwner
Definition VariableTypes.h:160
@ veDesiredId
Definition VariableTypes.h:154
@ veUserPrivate
Definition VariableTypes.h:168
@ veRemove
Definition VariableTypes.h:156
@ veFlagsChange
Definition VariableTypes.h:140
@ veUnlinked
Definition VariableTypes.h:164
@ veNewId
Definition VariableTypes.h:134
@ veGetOwner
Definition VariableTypes.h:158
@ veUserGlobal
Definition VariableTypes.h:136
@ veConvert
Definition VariableTypes.h:132
@ veSetup
Definition VariableTypes.h:166
@ veUserLocal
Definition VariableTypes.h:148
@ veFirstLocal
Definition VariableTypes.h:138
@ veValueChange
Definition VariableTypes.h:142
@ veConverted
Definition VariableTypes.h:146
@ veInvalid
Definition VariableTypes.h:144
@ veIdChanged
Definition VariableTypes.h:152
@ veFirstPrivate
Definition VariableTypes.h:150
TVector< VariableReference * > ReferenceVector
Types for internal use.
Definition VariableTypes.h:41
TVector< Variable > Vector
Vector for instances of variables.
Definition VariableTypes.h:36
EField
Enumeration of the order of fields in the setup string.
Definition VariableTypes.h:175
@ vfId
Definition VariableTypes.h:177
@ vfUnit
Definition VariableTypes.h:181
@ vfDefault
Definition VariableTypes.h:193
@ vfDescription
Definition VariableTypes.h:185
@ vfMinimum
Definition VariableTypes.h:195
@ vfRound
Definition VariableTypes.h:191
@ vfFlags
Definition VariableTypes.h:183
@ vfFirstState
Definition VariableTypes.h:199
@ vfType
Definition VariableTypes.h:187
@ vfMaximum
Definition VariableTypes.h:197
@ vfConversionType
Definition VariableTypes.h:189
@ vfName
Definition VariableTypes.h:179
@ Variable
Definition Namespace.h:24
Definition Application.h:10
Structure used to set up a variable The method Variable::getDefinition() transforms the definition st...
Definition VariableTypes.h:274
Value _maxValue
Maximum limit of this instance. When the min and max limits are zero no limits are applied.
Definition VariableTypes.h:325
Value _roundValue
Rounding value. The value is a multiple of this value.
Definition VariableTypes.h:312
Value _defaultValue
This is the value this instance starts with.
Definition VariableTypes.h:316
std::string _convertOption
Additional option used during conversion. (not used yet)
Definition VariableTypes.h:304
bool _valid
Flag indicating this structure is valid.
Definition VariableTypes.h:279
std::string _name
Name path separated using '|' characters.
Definition VariableTypes.h:287
std::string _unit
unit preferably in SI units so conversion and calculations are simple. Also used to Set the string f...
Definition VariableTypes.h:300
id_type _id
The id of the new global instance.
Definition VariableTypes.h:283
State::Vector _states
A vector of VariableTypes::State` instances.
Definition VariableTypes.h:329
Value _minValue
Minimum limit of this instance. When the min and max limits are zero no limits are applied.
Definition VariableTypes.h:320
flags_type _flags
Combination of EFlag flags.
Definition VariableTypes.h:291
Value::EType _type
Internal type of the instance.
Definition VariableTypes.h:308
std::string _description
Description of the instance without comma's.
Definition VariableTypes.h:295