diff options
author | Sean Wilson <spwilson2@wisc.edu> | 2017-06-07 16:32:15 -0500 |
---|---|---|
committer | Sean Wilson <spwilson2@wisc.edu> | 2017-06-20 18:03:21 +0000 |
commit | c8668a663992264911545f8001d462e0885b114c (patch) | |
tree | b91e2fd0b64f01f4606b4d3c9efae91623276652 /src/dev/net/dist_etherlink.hh | |
parent | 475f613f2661f3be5f7479c5c7229e5adcb74d93 (diff) | |
download | gem5-c8668a663992264911545f8001d462e0885b114c.tar.xz |
dev: Replace EventWrapper use with EventFunctionWrapper
Change-Id: I6b03cc6f67e76dffb79940431711ae6171901c6a
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/3748
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/dev/net/dist_etherlink.hh')
-rw-r--r-- | src/dev/net/dist_etherlink.hh | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/dev/net/dist_etherlink.hh b/src/dev/net/dist_etherlink.hh index e8218941a..83f28f2b2 100644 --- a/src/dev/net/dist_etherlink.hh +++ b/src/dev/net/dist_etherlink.hh @@ -118,15 +118,13 @@ class DistEtherLink : public EtherObject * Send done callback. Called from doneEvent. */ void txDone(); - typedef EventWrapper<TxLink, &TxLink::txDone> DoneEvent; - friend void DoneEvent::process(); - DoneEvent doneEvent; + EventFunctionWrapper doneEvent; public: TxLink(const std::string &name, DistEtherLink *p, double invBW, Tick delay_var, EtherDump *d) : Link(name, p, d, &doneEvent), ticksPerByte(invBW), - delayVar(delay_var), doneEvent(this) {} + delayVar(delay_var), doneEvent([this]{ txDone(); }, name) {} ~TxLink() {} /** @@ -159,16 +157,14 @@ class DistEtherLink : public EtherObject * Receive done callback method. Called from doneEvent. */ void rxDone(); - typedef EventWrapper<RxLink, &RxLink::rxDone> DoneEvent; - friend void DoneEvent::process(); - DoneEvent _doneEvent; + EventFunctionWrapper _doneEvent; public: RxLink(const std::string &name, DistEtherLink *p, Tick delay, EtherDump *d) : - Link(name, p, d, &_doneEvent), - linkDelay(delay), _doneEvent(this) {} + Link(name, p, d, &_doneEvent), linkDelay(delay), + _doneEvent([this]{ rxDone(); }, name) {} ~RxLink() {} /** @@ -178,7 +174,7 @@ class DistEtherLink : public EtherObject /** * Done events will be scheduled by DistIface (so we need the accessor) */ - const DoneEvent *doneEvent() const { return &_doneEvent; } + const EventFunctionWrapper *doneEvent() const { return &_doneEvent; } }; /** |