MotorControlModuleSDFM_TMS3.../Projects/EFC_Application/UMLibrary/technological/adapter/ControlSystemTie.hh

37 lines
800 B
C++

/*
* ControlSystemTie.hh
*
* Created on: 30 ìàÿ 2020 ã.
* Author: LeonidTitov
*/
#ifndef UMLIBRARY_TECHNOLOGICAL_ADAPTER_CONTROLSYSTEMTIE_HH_
#define UMLIBRARY_TECHNOLOGICAL_ADAPTER_CONTROLSYSTEMTIE_HH_
#include "ControlSystemWrapper.hpp"
namespace technological { namespace adapter {
template<class Interconnect, class Output>
struct OnControlUnitConnect {
void operator()( Interconnect * control_unit, Output * output ) {
control_unit->set_output(output);
control_unit->reset();
}
};
template<class Interconnect>
struct OnControlUnitDisconnect {
void operator()( Interconnect * control_unit ) {
control_unit->reset();
control_unit->set_output( nullptr );
}
};
}}
#endif /* UMLIBRARY_TECHNOLOGICAL_ADAPTER_CONTROLSYSTEMTIE_HH_ */