61#ifndef __SIM_PROBE_PROBE_HH__
62#define __SIM_PROBE_PROBE_HH__
154template <
typename Listener = ProbeListener>
197 template <
typename Listener,
typename... Args>
201 new Listener(std::forward<Args>(args)...),
237template <
class T,
class Arg>
271template <
typename Arg>
300 panic_if(!
l,
"Wrong type of listener: expected %s got %s",
302 typeid(*l_base).name());
318 panic_if(!
l,
"Wrong type of listener expected %s got %s",
320 typeid(*l_base).name());
Named(std::string_view name_)
ProbeListenerArgBase is used to define the base interface to a ProbeListenerArg (i....
ProbeListenerArgBase(std::string name)
virtual void notify(const Arg &val)=0
std::function< void(const Arg &)> NotifyFunction
ProbeListenerArgFunc(const std::string &name, const NotifyFunction &func)
void notify(const Arg &val) override
called when the ProbePoint calls notify.
void(LocalInstTracker::* function)(const uint64_t &)
void notify(const Arg &val) override
called when the ProbePoint calls notify.
LocalInstTracker * object
ProbeListenerArg(T *obj, std::string name, void(T::*func)(const Arg &))
ProbeListener base class; here to simplify things like containers containing multiple types of ProbeL...
ProbeListener & operator=(const ProbeListener &other)=delete
ProbeListener(std::string _name)
virtual ~ProbeListener()=default
ProbeListener & operator=(ProbeListener &&other) noexcept=delete
ProbeListener(ProbeListener &&other) noexcept=delete
ProbeListener(const ProbeListener &other)=delete
const std::string & getName() const
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
bool addListener(std::string_view point_name, ProbeListener &listener)
Add a ProbeListener to the ProbePoint named by pointName.
void addPoint(ProbePoint &point)
Add a ProbePoint to this SimObject ProbeManager.
bool removeListener(std::string_view point_name, ProbeListener &listener)
Remove a ProbeListener from the ProbePoint named by pointName.
std::vector< ProbePoint * > points
Vector for name look-up.
ProbeListenerPtr< Listener > connect(Args &&...args)
ProbeManager(const std::string &obj_name)
ProbePoint * getFirstProbePoint(std::string_view point_name) const
bool hasListeners() const
Informs whether any listeners are attached to this probe.
void notify(const Arg &arg)
called at the ProbePoint call site, passes arg to each listener.
ProbePointArg(ProbeManager *manager, std::string name)
void removeListener(ProbeListener *l_base) override
remove a ProbeListener from this ProbePoints notify list.
std::vector< ProbeListenerArgBase< PacketInfo > * > listeners
void addListener(ProbeListener *l_base) override
adds a ProbeListener to this ProbePoints notify list.
ProbePoint base class; again used to simplify use of ProbePoints in containers and used as to define ...
virtual void removeListener(ProbeListener *listener)=0
const std::string & getName() const
ProbePoint(ProbeManager *manager, const std::string &name)
virtual void addListener(ProbeListener *listener)=0
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Name space containing shared probe point declarations.
Copyright (c) 2024 Arm Limited All rights reserved.
std::unique_ptr< Listener, ProbeListenerCleanup > ProbeListenerPtr
This typedef should be used instead of a raw std::unique_ptr<> since we have to disconnect the listen...
Overload hash function for BasicBlockRange type.
ProbeListenerCleanup(ProbeManager *m)
void operator()(ProbeListener *listener) const