xo-reactor: bugfix: track ns change xo::ref::rp -> xo::rp

This commit is contained in:
Roland Conybeare 2024-09-14 13:48:03 -05:00
commit aa40c8ac75
14 changed files with 20 additions and 26 deletions

View file

@ -25,7 +25,7 @@ namespace xo {
/* find all event processors ep reachable from x (i.e. downstream from x). /* find all event processors ep reachable from x (i.e. downstream from x).
* report each such ep exactly once * report each such ep exactly once
*/ */
static std::vector<ref::rp<AbstractEventProcessor>> map_network(ref::rp<AbstractEventProcessor> const & x); static std::vector<rp<AbstractEventProcessor>> map_network(rp<AbstractEventProcessor> const & x);
/* visit direct downstream consumers c[i] of this event processor. /* visit direct downstream consumers c[i] of this event processor.
* call ep(c[i]) for each such consumer. * call ep(c[i]) for each such consumer.

View file

@ -59,7 +59,7 @@ namespace xo {
* with a function thats calls a .notify_xxx() method * with a function thats calls a .notify_xxx() method
* on this Sink * on this Sink
*/ */
virtual void attach_source(ref::rp<AbstractSource> const & src) = 0; virtual void attach_source(rp<AbstractSource> const & src) = 0;
/* accept incoming event, given by tagged pointer */ /* accept incoming event, given by tagged pointer */
virtual void notify_ev_tp(TaggedPtr const & ev_tp) = 0; virtual void notify_ev_tp(TaggedPtr const & ev_tp) = 0;

View file

@ -64,7 +64,7 @@ namespace xo {
/* set .trace_sim_flag */ /* set .trace_sim_flag */
virtual void set_debug_sim_flag(bool x) = 0; virtual void set_debug_sim_flag(bool x) = 0;
virtual CallbackId attach_sink(ref::rp<AbstractSink> const & sink) = 0; virtual CallbackId attach_sink(rp<AbstractSink> const & sink) = 0;
virtual void detach_sink(CallbackId id) = 0; virtual void detach_sink(CallbackId id) = 0;
/* endpoint for a websocket subscriber; /* endpoint for a websocket subscriber;
@ -92,7 +92,7 @@ namespace xo {
std::uint64_t deliver_all(); std::uint64_t deliver_all();
}; /*AbstractSource*/ }; /*AbstractSource*/
using AbstractSourcePtr = ref::rp<AbstractSource>; using AbstractSourcePtr = rp<AbstractSource>;
} /*namespace reactor*/ } /*namespace reactor*/
} /*namespace xo*/ } /*namespace xo*/

View file

@ -15,7 +15,7 @@ namespace xo {
using CallbackId = fn::CallbackId; using CallbackId = fn::CallbackId;
public: public:
virtual CallbackId add_callback(ref::rp<Callback> const & cb) = 0; virtual CallbackId add_callback(rp<Callback> const & cb) = 0;
virtual void remove_callback(CallbackId id) = 0; virtual void remove_callback(CallbackId id) = 0;
}; /*EventSource*/ }; /*EventSource*/

View file

@ -20,10 +20,10 @@ namespace xo {
}; };
template <typename T> template <typename T>
class EventTimeFn<xo::ref::rp<T>> { class EventTimeFn<xo::rp<T>> {
public: public:
using utc_nanos = xo::time::utc_nanos; using utc_nanos = xo::time::utc_nanos;
using event_t = xo::ref::rp<T>; using event_t = xo::rp<T>;
public: public:
static utc_nanos event_tm(event_t const & ev) { return ev->tm(); } static utc_nanos event_tm(event_t const & ev) { return ev->tm(); }

View file

@ -29,7 +29,7 @@ namespace xo {
using utc_nanos = xo::time::utc_nanos; using utc_nanos = xo::time::utc_nanos;
public: public:
static ref::rp<FifoQueue> make(EvTimeFn evtm_fn = EvTimeFn()) { return new FifoQueue(evtm_fn); } static rp<FifoQueue> make(EvTimeFn evtm_fn = EvTimeFn()) { return new FifoQueue(evtm_fn); }
// ----- inherited from Sink1<T> ----- // ----- inherited from Sink1<T> -----
@ -141,8 +141,8 @@ namespace xo {
virtual bool debug_sim_flag() const override { return debug_sim_flag_; } 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 void set_debug_sim_flag(bool x) override { this->debug_sim_flag_ = x; }
virtual CallbackId attach_sink(ref::rp<AbstractSink> const & sink) override { virtual CallbackId attach_sink(rp<AbstractSink> const & sink) override {
ref::rp<EventSink> native_sink rp<EventSink> native_sink
= EventSink::require_native("FifoQueue::attach_sink", sink); = EventSink::require_native("FifoQueue::attach_sink", sink);
if (native_sink) { if (native_sink) {
@ -168,7 +168,7 @@ namespace xo {
// ----- inherited from EventSource ----- // ----- inherited from EventSource -----
virtual CallbackId add_callback(ref::rp<EventSink> const & cb) override { virtual CallbackId add_callback(rp<EventSink> const & cb) override {
return this->cb_set_.add_callback(cb); return this->cb_set_.add_callback(cb);
} }

View file

@ -13,7 +13,7 @@ namespace xo {
class PollingReactor : public Reactor { class PollingReactor : public Reactor {
public: public:
/* named ctor idiom */ /* named ctor idiom */
static ref::rp<PollingReactor> make() { return new PollingReactor(); } static rp<PollingReactor> make() { return new PollingReactor(); }
// ----- inherited from Reactor ----- // ----- inherited from Reactor -----

View file

@ -29,10 +29,10 @@ namespace xo {
public: public:
/* named ctor idiom */ /* named ctor idiom */
static ref::rp<PolyAdapterSink> make(ref::rp<AbstractSink> poly_sink) { static rp<PolyAdapterSink> make(rp<AbstractSink> poly_sink) {
//xo::scope lscope("PolyAdapterSink::make"); //xo::scope lscope("PolyAdapterSink::make");
ref::rp<PolyAdapterSink> retval(new PolyAdapterSink(poly_sink)); rp<PolyAdapterSink> retval(new PolyAdapterSink(poly_sink));
//lscope.log("adapter", (void*)retval.get()); //lscope.log("adapter", (void*)retval.get());
@ -80,11 +80,11 @@ namespace xo {
} /*display*/ } /*display*/
private: private:
PolyAdapterSink(ref::rp<AbstractSink> poly_sink) : poly_sink_{std::move(poly_sink)} {} PolyAdapterSink(rp<AbstractSink> poly_sink) : poly_sink_{std::move(poly_sink)} {}
private: private:
/* mandate: .poly_sink.allow_polymorphic_source() is true */ /* mandate: .poly_sink.allow_polymorphic_source() is true */
ref::rp<AbstractSink> poly_sink_; rp<AbstractSink> poly_sink_;
}; /*PolyAdapterSink*/ }; /*PolyAdapterSink*/
} /*namespace reactor*/ } /*namespace reactor*/
} /*namespace xo*/ } /*namespace xo*/

View file

@ -123,7 +123,7 @@ namespace xo {
uint64_t online_advance_until(utc_nanos tm, bool replay_flag); uint64_t online_advance_until(utc_nanos tm, bool replay_flag);
}; /*ReactorSource*/ }; /*ReactorSource*/
using ReactorSourcePtr = ref::rp<ReactorSource>; using ReactorSourcePtr = rp<ReactorSource>;
} /*namespace reactor*/ } /*namespace reactor*/
} /*namespace xo*/ } /*namespace xo*/

View file

@ -40,8 +40,8 @@ namespace xo {
/* convenience: convert abstract sink to Sink1<T>*, /* convenience: convert abstract sink to Sink1<T>*,
* or throw * or throw
*/ */
static ref::rp<Sink1<T>> require_native(std::string_view caller, static rp<Sink1<T>> require_native(std::string_view caller,
ref::rp<AbstractSink> const & sink) rp<AbstractSink> const & sink)
{ {
using xo::scope; using xo::scope;
using xo::xtag; using xo::xtag;
@ -112,7 +112,7 @@ namespace xo {
/* Sink1<T> only allows source providing T */ /* Sink1<T> only allows source providing T */
virtual bool allow_polymorphic_source() const override { return false; } virtual bool allow_polymorphic_source() const override { return false; }
virtual void attach_source(ref::rp<AbstractSource> const & src) override { virtual void attach_source(rp<AbstractSource> const & src) override {
src->attach_sink(this); src->attach_sink(this);
} /*attach_source*/ } /*attach_source*/

View file

@ -6,7 +6,6 @@
#include <map> #include <map>
namespace xo { namespace xo {
using ref::rp;
using ref::brw; using ref::brw;
using xo::tostr; using xo::tostr;
using std::uint32_t; using std::uint32_t;

View file

@ -8,9 +8,6 @@
namespace xo { namespace xo {
using xo::web::StreamEndpointDescr; using xo::web::StreamEndpointDescr;
using xo::reactor::AbstractSink; using xo::reactor::AbstractSink;
using xo::ref::rp;
//using xo::scope;
//using xo::tostr;
namespace reactor { namespace reactor {
StreamEndpointDescr StreamEndpointDescr

View file

@ -13,7 +13,6 @@ namespace xo {
using xo::reactor::PollingReactor; using xo::reactor::PollingReactor;
using xo::reactor::FifoQueue; using xo::reactor::FifoQueue;
using xo::reactor::SinkToFunction; using xo::reactor::SinkToFunction;
using xo::ref::rp;
using xo::time::timeutil; using xo::time::timeutil;
using xo::time::seconds; using xo::time::seconds;
using xo::time::utc_nanos; using xo::time::utc_nanos;

View file

@ -13,7 +13,6 @@ namespace xo {
using xo::reactor::SinkEndpoint; using xo::reactor::SinkEndpoint;
using xo::reactor::SinkToConsole; using xo::reactor::SinkToConsole;
using xo::time::utc_nanos; using xo::time::utc_nanos;
using xo::ref::rp;
namespace { namespace {
class TestSink : public SinkEndpoint<int> { class TestSink : public SinkEndpoint<int> {