ChimeraTK-DeviceAccess  03.18.00
LNMVariable.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 #pragma once
4 
5 #include "TransferElement.h"
6 
7 #include <boost/shared_ptr.hpp>
8 
9 #include <mutex>
10 
11 namespace ChimeraTK {
12 
13  namespace LNMBackend {
14  class MathPlugin;
15  }
16 
17  struct LNMVariable {
22  template<typename T>
23  struct ValueTable {
24  std::vector<T> latestValue;
27  struct QueuedValue {
28  std::vector<T> value;
31  };
32  std::map<TransferElementID, cppext::future_queue<QueuedValue>> subscriptions;
33  };
35 
37  std::mutex valueTable_mutex;
38 
40  std::set<LNMBackend::MathPlugin*> usingFormulas;
41 
44 
46  bool isConstant{false};
47  };
48 
49 } /* namespace ChimeraTK */
ChimeraTK::LNMVariable::valueType
ChimeraTK::DataType valueType
type of the variable
Definition: LNMVariable.h:43
ChimeraTK::LNMVariable::ValueTable::subscriptions
std::map< TransferElementID, cppext::future_queue< QueuedValue > > subscriptions
Definition: LNMVariable.h:32
ChimeraTK::LNMVariable::isConstant
bool isConstant
flag whether this variable is actaully a constant
Definition: LNMVariable.h:46
ChimeraTK::TemplateUserTypeMap
Map of UserType to a class template with the UserType as template argument.
Definition: SupportedUserTypes.h:421
TransferElement.h
ChimeraTK::LNMVariable::ValueTable::QueuedValue::validity
DataValidity validity
Definition: LNMVariable.h:29
ChimeraTK::LNMVariable::ValueTable::QueuedValue
Definition: LNMVariable.h:27
ChimeraTK::LNMVariable::ValueTable::latestValidity
DataValidity latestValidity
Definition: LNMVariable.h:25
ChimeraTK::LNMVariable
Definition: LNMVariable.h:17
ChimeraTK::LNMVariable::valueTable_mutex
std::mutex valueTable_mutex
Mutex one needs to hold while accessing valueTable.
Definition: LNMVariable.h:37
ChimeraTK::LNMVariable::ValueTable::latestValue
std::vector< T > latestValue
Definition: LNMVariable.h:24
ChimeraTK::LNMVariable::ValueTable
Hold values of CONSTANT or VARIABLE types in a type-dependent table.
Definition: LNMVariable.h:23
ChimeraTK::DataValidity::ok
@ ok
ChimeraTK::DataValidity
DataValidity
The current state of the data.
Definition: TransferElement.h:41
ChimeraTK::LNMVariable::ValueTable::QueuedValue::version
VersionNumber version
Definition: LNMVariable.h:30
ChimeraTK::LNMVariable::valueTable
TemplateUserTypeMap< ValueTable > valueTable
Definition: LNMVariable.h:34
ChimeraTK::DataType
A class to describe which of the supported data types is used.
Definition: SupportedUserTypes.h:599
ChimeraTK::LNMVariable::ValueTable::QueuedValue::value
std::vector< T > value
Definition: LNMVariable.h:28
ChimeraTK::VersionNumber
Class for generating and holding version numbers without exposing a numeric representation.
Definition: VersionNumber.h:23
ChimeraTK::LNMVariable::ValueTable::latestVersion
VersionNumber latestVersion
Definition: LNMVariable.h:26
ChimeraTK
Definition: DummyBackend.h:16
ChimeraTK::LNMVariable::usingFormulas
std::set< LNMBackend::MathPlugin * > usingFormulas
formulas which need updates after variable was written
Definition: LNMVariable.h:40