MotorControlModuleSDFM_TMS3.../Projects/EFC_Application/UMLibrary/schematic/action/ValueGetAction.hpp

45 lines
877 B
C++

/*
* 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_ */