40 lines
801 B
C++
40 lines
801 B
C++
/*
|
||
* 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_ */
|