Bugzilla – Full Text Bug Listing |
Summary: | Use std::function to implement callbacks | ||
---|---|---|---|
Product: | ns-3 | Reporter: | Stefano Avallone <stavallo> |
Component: | core | Assignee: | Peter Barnes <pdbarnes> |
Status: | RESOLVED MOVED | ||
Severity: | enhancement | CC: | krotov, natale.patriciello, ns-bugs |
Priority: | P5 | ||
Version: | ns-3-dev | ||
Hardware: | PC | ||
OS: | All |
Description
Stefano Avallone
2018-11-14 06:36:54 EST
Hi Stefano, how does the patch compare with bug 2457? Is it a complete replacement? In reply to natale.patriciello from comment #1) > Hi Stefano, > > how does the patch compare with bug 2457? Is it a complete replacement? It uses only part of the bug 2457 patch in the first commit: https://github.com/stavallo/ns-3-dev-git/commit/79d5fb961945a1a10eaf7eec299e648216b20bb2 So it is not a complete replacement, it is an addition. @Stefano Avallone: why not build on top of the whole bug 2457 patch? > how does the patch compare with bug 2457? Is it a complete replacement?
Good question. I should have mentioned first.
My patch:
- is a replacement for Alexander's changes to callback.h only (see also below)
- depends on Alexander's changes to trace-callback.h (which I borrowed without any change)
- is independent of the changes that Alexander made to other files
Concerning the changes to callback.h, Alexander only used variadic templates to simplify the definition of the three variants of MakeCallback and MakeNullCallback. So, I would say that his patch only achieves (partly) the first of the three goals I listed above.
(In reply to Alexander Krotov from comment #2) > It uses only part of the bug 2457 patch in the first commit: > https://github.com/stavallo/ns-3-dev-git/commit/ > 79d5fb961945a1a10eaf7eec299e648216b20bb2 > > So it is not a complete replacement, it is an addition. Correct. > @Stefano Avallone: why not build on top of the whole bug 2457 patch? For the moment, I chose not to depend on your patch, except for the piece I really needed. However, if your patch will be merged first (and soon, I hope!) I will rebase my patch on top of yours. Moved to GitLab: https://gitlab.com/nsnam/ns-3-dev/-/merge_requests/278 |