MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/systemic/ApplyParameter.hpp
2024-06-07 11:12:56 +03:00

45 lines
810 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.

/*
* ApplyParameter.hpp
*
* Created on: 7 апр. 2021 г.
* Author: titov
*/
#ifndef UMLIBRARY_SYSTEMIC_APPLYPARAMETER_HPP_
#define UMLIBRARY_SYSTEMIC_APPLYPARAMETER_HPP_
#include "IFunctor.hh"
#include "CustomParameters.hpp"
namespace systemic {
template<typename Object>
class ApplyParameter : public IFunctor<void> {
Object & object;
Parameter<Object> parameter;
public:
void operator()();
ApplyParameter( Object & object, Parameter<Object> parameter ) :
object(object), parameter(parameter) {}
};
}
template<typename Object>
inline void systemic::ApplyParameter<Object>::operator ()() {
LocalSetting<Object> ls( parameter );
if( ls.setting.isValid() )
object.configure( ls.setting );
}
#endif /* UMLIBRARY_SYSTEMIC_APPLYPARAMETER_HPP_ */