You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 lines
822 B

  1. #pragma once
  2. #include <type_traits>
  3. #include "result.h"
  4. #include "stream.pre.h"
  5. namespace asyncpp
  6. {
  7. template<
  8. typename T_object,
  9. typename T_impl>
  10. struct stream
  11. {
  12. using object_type = T_object;
  13. using clean_object_type = std::decay_t<object_type>;
  14. using trait_type = stream_trait<clean_object_type>;
  15. using value_type = typename trait_type::value_type;
  16. using result_type = stream_result<value_type>;
  17. object_type ref;
  18. /**
  19. * @brief Value constructor.
  20. */
  21. template<typename X_object>
  22. inline stream(X_object&& p_ref);
  23. /**
  24. * @brief Function that will be called repeatedly to check if the stream has values.
  25. */
  26. inline result_type poll();
  27. };
  28. }