From e3a53d10e6b6a6c7246f0ea72df5da4df7150301 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 14 Sep 2024 13:56:48 -0500 Subject: [PATCH] xo-reactor: bugfix: xo::ref::rp -> xo::rp --- include/xo/reactor/DirectSourcePtr.hpp | 2 +- include/xo/reactor/EventStore.hpp | 10 +++++----- include/xo/reactor/SecondarySource.hpp | 8 ++++---- include/xo/reactor/Sink.hpp | 2 +- src/reactor/Sink.cpp | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/xo/reactor/DirectSourcePtr.hpp b/include/xo/reactor/DirectSourcePtr.hpp index 8947a74a..f68eb27c 100644 --- a/include/xo/reactor/DirectSourcePtr.hpp +++ b/include/xo/reactor/DirectSourcePtr.hpp @@ -13,7 +13,7 @@ namespace xo { LastReducer>>; - /* use when Event is ref::rp for some T */ + /* use when Event is rp for some T */ template using DirectSourcePtr = SecondarySource const & pjson, + virtual void http_snapshot(rp const & pjson, std::ostream * p_os) const = 0; /* http endpoint; generates http output for this eventstore */ - virtual HttpEndpointDescr http_endpoint_descr(ref::rp const & pjson, + virtual HttpEndpointDescr http_endpoint_descr(rp const & pjson, std::string const & url_prefix) const { /* important that lambda contains its own rp; * reference to stack will not do */ - ref::rp pjson_rp = pjson; + rp pjson_rp = pjson; auto http_fn = ([this, pjson_rp] (std::string const & /*uri*/, @@ -118,7 +118,7 @@ namespace xo { using Alist = xo::web::Alist; using HttpEndpointDescr = xo::web::HttpEndpointDescr; - static ref::rp make() { return new EventStoreImpl(); } + static rp make() { return new EventStoreImpl(); } /* visit most recent n events in this store. * returns #of events actually visited @@ -206,7 +206,7 @@ namespace xo { virtual std::uint32_t size() const override { return tree_.size(); } /* write http snapshot of current state to *p_os */ - virtual void http_snapshot(ref::rp const & pjson, std::ostream * p_os) const override { + virtual void http_snapshot(rp const & pjson, std::ostream * p_os) const override { using xo::reflect::Reflect; /* visit last 100 events; diff --git a/include/xo/reactor/SecondarySource.hpp b/include/xo/reactor/SecondarySource.hpp index 3b10de63..5b186b83 100644 --- a/include/xo/reactor/SecondarySource.hpp +++ b/include/xo/reactor/SecondarySource.hpp @@ -29,7 +29,7 @@ namespace xo { public: ~SecondarySource() = default; - static ref::rp make() { return new SecondarySource(); } + static rp make() { return new SecondarySource(); } /* last event delivered from this source -- * i.e. event in most recent call to .deliver_one_aux() @@ -114,7 +114,7 @@ namespace xo { // ----- inherited from EventSource ----- - virtual CallbackId add_callback(ref::rp const & cb) override { + virtual CallbackId add_callback(rp const & cb) override { return this->cb_set_.add_callback(cb); } /*add_callback*/ @@ -195,8 +195,8 @@ namespace xo { virtual bool debug_sim_flag() const override { return debug_sim_flag_; } virtual void set_debug_sim_flag(bool x) override { this->debug_sim_flag_ = x; } - virtual CallbackId attach_sink(ref::rp const & sink) override { - ref::rp native_sink + virtual CallbackId attach_sink(rp const & sink) override { + rp native_sink = EventSink::require_native("SecondarySource::attach_sink", sink); if (native_sink) { diff --git a/include/xo/reactor/Sink.hpp b/include/xo/reactor/Sink.hpp index dab326f9..a5f29a03 100644 --- a/include/xo/reactor/Sink.hpp +++ b/include/xo/reactor/Sink.hpp @@ -213,7 +213,7 @@ namespace xo { #ifdef NOT_USING class TemporaryTest { public: - static ref::rp>> realization_printer(); + static rp>> realization_printer(); }; /*TemporaryTest*/ #endif } /*namespace reactor*/ diff --git a/src/reactor/Sink.cpp b/src/reactor/Sink.cpp index 1dbcdb62..78f281e8 100644 --- a/src/reactor/Sink.cpp +++ b/src/reactor/Sink.cpp @@ -6,7 +6,7 @@ namespace xo { namespace reactor { #ifdef NOT_USING - ref::rp>> + rp>> TemporaryTest::realization_printer() { return new SinkToConsole>();