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

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

/*
* SyncAsync.hpp
*
* Created on: 12 сент. 2020 г.
* Author: LeonidTitov
*/
#ifndef UMLIBRARY_SCHEMATIC_SYNCASYNC_HPP_
#define UMLIBRARY_SCHEMATIC_SYNCASYNC_HPP_
#include "../systemic/IValueAsync.hpp"
#include "../systemic/IValue.hpp"
namespace schematic {
template<typename T>
class ViewValueAsync : public systemic::IValue<T> {
public:
ViewValueAsync( const systemic::IValueType<T> & async );
operator T() const;
private:
const systemic::IValueType<T> & async;
};
}
template<typename T>
inline schematic::ViewValueAsync<T>::ViewValueAsync(
const systemic::IValueType<T> & async ) : async(async) {}
template<typename T>
inline schematic::ViewValueAsync<T>::operator T() const {
return async.get();
}
#endif /* UMLIBRARY_SCHEMATIC_SYNCASYNC_HPP_ */