xo-reactor: bugfix: track ns change xo::ref::rp -> xo::rp
This commit is contained in:
parent
000ed7b957
commit
aa40c8ac75
14 changed files with 20 additions and 26 deletions
|
|
@ -25,7 +25,7 @@ namespace xo {
|
|||
/* find all event processors ep reachable from x (i.e. downstream from x).
|
||||
* 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.
|
||||
* call ep(c[i]) for each such consumer.
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace xo {
|
|||
* with a function thats calls a .notify_xxx() method
|
||||
* 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 */
|
||||
virtual void notify_ev_tp(TaggedPtr const & ev_tp) = 0;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace xo {
|
|||
/* set .trace_sim_flag */
|
||||
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;
|
||||
|
||||
/* endpoint for a websocket subscriber;
|
||||
|
|
@ -92,7 +92,7 @@ namespace xo {
|
|||
std::uint64_t deliver_all();
|
||||
}; /*AbstractSource*/
|
||||
|
||||
using AbstractSourcePtr = ref::rp<AbstractSource>;
|
||||
using AbstractSourcePtr = rp<AbstractSource>;
|
||||
|
||||
} /*namespace reactor*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace xo {
|
|||
using CallbackId = fn::CallbackId;
|
||||
|
||||
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;
|
||||
}; /*EventSource*/
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ namespace xo {
|
|||
};
|
||||
|
||||
template <typename T>
|
||||
class EventTimeFn<xo::ref::rp<T>> {
|
||||
class EventTimeFn<xo::rp<T>> {
|
||||
public:
|
||||
using utc_nanos = xo::time::utc_nanos;
|
||||
using event_t = xo::ref::rp<T>;
|
||||
using event_t = xo::rp<T>;
|
||||
|
||||
public:
|
||||
static utc_nanos event_tm(event_t const & ev) { return ev->tm(); }
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace xo {
|
|||
using utc_nanos = xo::time::utc_nanos;
|
||||
|
||||
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> -----
|
||||
|
||||
|
|
@ -141,8 +141,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<AbstractSink> const & sink) override {
|
||||
ref::rp<EventSink> native_sink
|
||||
virtual CallbackId attach_sink(rp<AbstractSink> const & sink) override {
|
||||
rp<EventSink> native_sink
|
||||
= EventSink::require_native("FifoQueue::attach_sink", sink);
|
||||
|
||||
if (native_sink) {
|
||||
|
|
@ -168,7 +168,7 @@ namespace xo {
|
|||
|
||||
// ----- 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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace xo {
|
|||
class PollingReactor : public Reactor {
|
||||
public:
|
||||
/* named ctor idiom */
|
||||
static ref::rp<PollingReactor> make() { return new PollingReactor(); }
|
||||
static rp<PollingReactor> make() { return new PollingReactor(); }
|
||||
|
||||
// ----- inherited from Reactor -----
|
||||
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ namespace xo {
|
|||
|
||||
public:
|
||||
/* 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");
|
||||
|
||||
ref::rp<PolyAdapterSink> retval(new PolyAdapterSink(poly_sink));
|
||||
rp<PolyAdapterSink> retval(new PolyAdapterSink(poly_sink));
|
||||
|
||||
//lscope.log("adapter", (void*)retval.get());
|
||||
|
||||
|
|
@ -80,11 +80,11 @@ namespace xo {
|
|||
} /*display*/
|
||||
|
||||
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:
|
||||
/* mandate: .poly_sink.allow_polymorphic_source() is true */
|
||||
ref::rp<AbstractSink> poly_sink_;
|
||||
rp<AbstractSink> poly_sink_;
|
||||
}; /*PolyAdapterSink*/
|
||||
} /*namespace reactor*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ namespace xo {
|
|||
uint64_t online_advance_until(utc_nanos tm, bool replay_flag);
|
||||
}; /*ReactorSource*/
|
||||
|
||||
using ReactorSourcePtr = ref::rp<ReactorSource>;
|
||||
using ReactorSourcePtr = rp<ReactorSource>;
|
||||
} /*namespace reactor*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ namespace xo {
|
|||
/* convenience: convert abstract sink to Sink1<T>*,
|
||||
* or throw
|
||||
*/
|
||||
static ref::rp<Sink1<T>> require_native(std::string_view caller,
|
||||
ref::rp<AbstractSink> const & sink)
|
||||
static rp<Sink1<T>> require_native(std::string_view caller,
|
||||
rp<AbstractSink> const & sink)
|
||||
{
|
||||
using xo::scope;
|
||||
using xo::xtag;
|
||||
|
|
@ -112,7 +112,7 @@ namespace xo {
|
|||
/* Sink1<T> only allows source providing T */
|
||||
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);
|
||||
} /*attach_source*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue