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