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

42 lines
788 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.

/*
* IProcess.h
*
* Created on: 20 дек. 2017 г.
* Author: titov
*/
#ifndef SOURCE_SYSTEM_IPROCESS_H_
#define SOURCE_SYSTEM_IPROCESS_H_
namespace systemic {
//!Интерфейс процесса.
class IProcess {
public:
virtual void process() = 0;
virtual void setSampleTime( float ts_in_second ) { (void) ts_in_second; };
// ~IProcess() = default;
};
struct IProcessControl {
virtual void enable() = 0;
virtual void disable() = 0;
};
struct ProcCtrl : public systemic::IProcessControl {
void enable() {}
void disable() {}
virtual ~ProcCtrl() = default;
};
template<typename Condition>
void do_until( IProcess & obj, const Condition & condition ) {
while( condition )
obj.process();
}
}
#endif /* SOURCE_SYSTEM_IPROCESS_H_ */