BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
Operator.h
Go to the documentation of this file.
1#ifndef BPMNOS_Model_Operator_H
2#define BPMNOS_Model_Operator_H
3
4#include <memory>
5#include <optional>
6#include <set>
7#include <string>
8#include <bpmn++.h>
9#include <variant>
13#include "Attribute.h"
14#include "Expression.h"
15
16namespace BPMNOS::Model {
17
18/**
19 * @brief Class representing an operator allowing to manipulate attribute values.
20 **/
21class Operator {
22public:
25
26 std::string& id;
29 Attribute* attribute; ///< The status or data attribute to be modified by the operator
30
31 template <typename DataType>
32 void apply(BPMNOS::Values& status, DataType& data, BPMNOS::Values& globals) const;
33
34 /// Returns a pointer of type T of the node.
35 template<typename T> T* is() {
36 return dynamic_cast<T*>(this);
37 }
38
39 /// Returns a pointer of type T of the node.
40 template<typename T> const T* is() const {
41 return dynamic_cast<const T*>(this);
42 }
43private:
44 Attribute* getAttribute() const;
45};
46
47} // namespace BPMNOS::Model
48
49#endif // BPMNOS_Model_Operator_H
Class representing a mathematical expression.
Definition Expression.h:17
Class representing an operator allowing to manipulate attribute values.
Definition Operator.h:21
T * is()
Returns a pointer of type T of the node.
Definition Operator.h:35
const Expression expression
Definition Operator.h:27
std::string & id
Definition Operator.h:26
Attribute * attribute
The status or data attribute to be modified by the operator.
Definition Operator.h:29
XML::bpmnos::tOperator * element
Definition Operator.h:24
Operator(XML::bpmnos::tOperator *operator_, const AttributeRegistry &attributeRegistry)
Definition Operator.cpp:5
const T * is() const
Returns a pointer of type T of the node.
Definition Operator.h:40
void apply(BPMNOS::Values &status, DataType &data, BPMNOS::Values &globals) const
Definition Operator.cpp:16
const AttributeRegistry & attributeRegistry
Definition Operator.h:28