Add debug graph to static network
This commit is contained in:
@@ -172,4 +172,20 @@ private:
|
||||
ChannelStats stats_;
|
||||
};
|
||||
|
||||
// ── Channel probe — type-erased snapshot accessor ─────────────────────────────
|
||||
// Used by both Network and StaticNetwork for diagnostics.
|
||||
|
||||
struct IChannelProbe {
|
||||
virtual ~IChannelProbe() = default;
|
||||
virtual ChannelSnapshot snapshot() const = 0;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct ChannelProbe : IChannelProbe {
|
||||
const Channel<T>& ch;
|
||||
std::string name;
|
||||
ChannelProbe(const Channel<T>& c, std::string n) : ch(c), name(std::move(n)) {}
|
||||
ChannelSnapshot snapshot() const override { return ch.snapshot(name); }
|
||||
};
|
||||
|
||||
} // namespace kpn
|
||||
|
||||
Reference in New Issue
Block a user