Home | History | Annotate | Download | only in doxygen
      1 #include "rxcpp/rx.hpp"
      2 
      3 #include "rxcpp/rx-test.hpp"
      4 #include "catch.hpp"
      5 
      6 SCENARIO("empty sample"){
      7     printf("//! [empty sample]\n");
      8     auto values = rxcpp::observable<>::empty<int>();
      9     values.
     10         subscribe(
     11             [](int v){printf("OnNext: %d\n", v);},
     12             [](){printf("OnCompleted\n");});
     13     printf("//! [empty sample]\n");
     14 }
     15 
     16 SCENARIO("threaded empty sample"){
     17     printf("//! [threaded empty sample]\n");
     18     auto values = rxcpp::observable<>::empty<int>(rxcpp::observe_on_event_loop());
     19     values.
     20         as_blocking().
     21         subscribe(
     22             [](int v){printf("OnNext: %d\n", v);},
     23             [](){printf("OnCompleted\n");});
     24     printf("//! [threaded empty sample]\n");
     25 }
     26 
     27 SCENARIO("empty operator syntax sample"){
     28     using namespace rxcpp::sources;
     29 
     30     printf("//! [empty operator syntax sample]\n");
     31     auto values = empty<int>();
     32     values.
     33             subscribe(
     34             [](int v){printf("OnNext: %d\n", v);},
     35             [](){printf("OnCompleted\n");});
     36     printf("//! [empty operator syntax sample]\n");
     37 }
     38