/* * ValueSample.hpp * * Created on: 22 èþë. 2020 ã. * Author: LeonidTitov */ #ifndef UMLIBRARY_SCHEMATIC_VALUESAMPLE_HPP_ #define UMLIBRARY_SCHEMATIC_VALUESAMPLE_HPP_ #include "../systemic/IValue.hpp" #include "../systemic/IProcess.hh" namespace schematic { template class ValueSample : public systemic::IProcess { public: ValueSample( systemic::IValue & value ); const volatile T & getSample() const; void process(); private: systemic::IValue & value; T temp; }; } template inline schematic::ValueSample::ValueSample( systemic::IValue & value ) : value(value) {} template inline const volatile T& schematic::ValueSample::getSample() const { return temp; } template inline void schematic::ValueSample::process() { temp = value; } #endif /* UMLIBRARY_SCHEMATIC_VALUESAMPLE_HPP_ */