use xo::bp instead of xo::ref::brw
This commit is contained in:
parent
53b6adeef1
commit
dc6acaa18c
4 changed files with 15 additions and 18 deletions
|
|
@ -97,7 +97,7 @@ namespace xo {
|
|||
/* true iff src has been added to this simulator
|
||||
* (by .add_source())
|
||||
*/
|
||||
bool is_source_present(ref::brw<ReactorSource> src) const;
|
||||
bool is_source_present(bp<ReactorSource> src) const;
|
||||
|
||||
/* promise:
|
||||
* .next_tm() > .t0() || .is_exhausted()
|
||||
|
|
@ -199,21 +199,21 @@ namespace xo {
|
|||
|
||||
/* notification when nonprimed source becomes primed
|
||||
*/
|
||||
virtual void notify_source_primed(ref::brw<ReactorSource> src) override;
|
||||
virtual void notify_source_primed(bp<ReactorSource> src) override;
|
||||
|
||||
/* add a new simulation source.
|
||||
* event that precede .t0 will be discarded.
|
||||
*
|
||||
* returns true if src added; false if already present
|
||||
*/
|
||||
virtual bool add_source(ref::brw<ReactorSource> src) override;
|
||||
virtual bool add_source(bp<ReactorSource> src) override;
|
||||
|
||||
/* remove simulation source.
|
||||
* returns true if src removed; false if was not present
|
||||
*
|
||||
* (not typically needed for simulations)
|
||||
*/
|
||||
virtual bool remove_source(ref::brw<ReactorSource> src) override;
|
||||
virtual bool remove_source(bp<ReactorSource> src) override;
|
||||
|
||||
/* synonym for .advance_one_event() */
|
||||
virtual std::uint64_t run_one() override;
|
||||
|
|
@ -245,9 +245,9 @@ namespace xo {
|
|||
void complete_delivery_work();
|
||||
|
||||
/* complete reentrant call to .add_source() */
|
||||
void complete_add_source(ref::brw<ReactorSource> src);
|
||||
void complete_add_source(bp<ReactorSource> src);
|
||||
/* complete reentrant call to .remove_source() */
|
||||
void complete_remove_source(ref::brw<ReactorSource> src);
|
||||
void complete_remove_source(bp<ReactorSource> src);
|
||||
|
||||
friend class RaiiDeliveryWork;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
namespace xo {
|
||||
using xo::reactor::ReactorSource;
|
||||
using xo::ref::brw;
|
||||
using xo::time::utc_nanos;
|
||||
using xo::time::nanos;
|
||||
|
||||
|
|
@ -58,7 +57,7 @@ namespace xo {
|
|||
} /*dtor*/
|
||||
|
||||
bool
|
||||
Simulator::is_source_present(brw<ReactorSource> src) const
|
||||
Simulator::is_source_present(bp<ReactorSource> src) const
|
||||
{
|
||||
for (ReactorSourcePtr const & s : this->src_v_) {
|
||||
if (s == src)
|
||||
|
|
@ -89,12 +88,12 @@ namespace xo {
|
|||
} /*next_src*/
|
||||
|
||||
void
|
||||
Simulator::notify_source_primed(brw<ReactorSource> src)
|
||||
Simulator::notify_source_primed(bp<ReactorSource> src)
|
||||
{
|
||||
scope log(XO_ENTER1(always, src->debug_sim_flag()));
|
||||
|
||||
brw<ReactorSource> sim_src
|
||||
= brw<ReactorSource>::from(src);
|
||||
bp<ReactorSource> sim_src
|
||||
= bp<ReactorSource>::from(src);
|
||||
|
||||
log && log(xtag("src", (sim_src.get() != nullptr)),
|
||||
xtag("src.name", src->name()));
|
||||
|
|
@ -131,7 +130,7 @@ namespace xo {
|
|||
} /*notify_source_primed*/
|
||||
|
||||
void
|
||||
Simulator::complete_add_source(brw<ReactorSource> src)
|
||||
Simulator::complete_add_source(bp<ReactorSource> src)
|
||||
{
|
||||
/* also add to simulation heap */
|
||||
this->sim_heap_.push_back(SourceTimestamp(src->sim_current_tm(),
|
||||
|
|
@ -146,7 +145,7 @@ namespace xo {
|
|||
} /*complete_add_source*/
|
||||
|
||||
bool
|
||||
Simulator::add_source(brw<ReactorSource> sim_src)
|
||||
Simulator::add_source(bp<ReactorSource> sim_src)
|
||||
{
|
||||
scope log(XO_ENTER1(always, sim_src->debug_sim_flag()));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue