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

46 lines
947 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.

/*
* SetValue.hh
*
* Created on: 4 авг. 2020 г.
* Author: LeonidTitov
*/
#ifndef UMLIBRARY_SCHEMATIC_ACTION_SETVALUE_HH_
#define UMLIBRARY_SCHEMATIC_ACTION_SETVALUE_HH_
#include "../../systemic/IFunctor.hh"
#include "../../systemic/IValueAsync.hpp"
namespace schematic { namespace functor {
template<typename ValueType>
class SetValue : public systemic::IFunctor<void, ValueType> {
typedef systemic::IValueType<ValueType> Value;
typedef systemic::IFunctor<void> Action;
Value & value;
public:
SetValue( Value & value );
virtual void operator()( ValueType new_value );
};
}
}
template<typename ValueType>
inline schematic::functor::SetValue<ValueType>::SetValue( Value & value ) : value(value) {}
template<typename ValueType>
inline void schematic::functor::SetValue<ValueType>::operator()( ValueType new_value) {
value.set( new_value );
}
#endif /* UMLIBRARY_SCHEMATIC_ACTION_SETVALUE_HH_ */