MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/schematic/action/ValueGetAction.hpp
2024-06-07 11:12:56 +03:00

45 lines
881 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* ValueGetAction.hpp
*
* Created on: 23 июн. 2023 г.
* Author: titov
*/
#ifndef UMLIBRARY_SCHEMATIC_ACTION_VALUEGETACTION_HPP_
#define UMLIBRARY_SCHEMATIC_ACTION_VALUEGETACTION_HPP_
#include "../../systemic/IFunctor.hh"
#include "../../systemic/IValue.hpp"
namespace schematic { namespace functor {
template<typename ValueType>
struct ValueGetAction : public systemic::IFunctor<ValueType> {
typedef systemic::IValue<ValueType> Value;
typedef systemic::IFunctor<void> Action;
Value & value;
Action & action;
ValueType operator()();
ValueGetAction( Value & value, Action & action ) : value(value), action(action) {}
};
}
}
template<typename ValueType>
inline ValueType schematic::functor::ValueGetAction<ValueType>::operator()() {
action();
return value;
}
#endif /* UMLIBRARY_SCHEMATIC_ACTION_VALUEGETACTION_HPP_ */