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

40 lines
723 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.

/*
* ApplySetting.hpp
*
* Created on: 7 июл. 2020 г.
* Author: LeonidTitov
*/
#ifndef UMLIBRARY_SYSTEMIC_APPLYSETTING_HPP_
#define UMLIBRARY_SYSTEMIC_APPLYSETTING_HPP_
#include "IFunctor.hh"
namespace systemic {
template<typename Object>
class ApplySetting : public IFunctor<void> {
Object & object;
typename Object::Setting & config;
public:
void operator()();
ApplySetting( Object & object, typename Object::Setting & config ) :
object(object), config(config) {}
};
}
template<typename Object>
inline void systemic::ApplySetting<Object>::operator ()() {
if( config.isValid() )
object.configure( config );
}
#endif /* UMLIBRARY_SYSTEMIC_APPLYSETTING_HPP_ */