64#ifndef __SIM_PROBE_PROBE_HH__
65#define __SIM_PROBE_PROBE_HH__
80struct ProbeListenerObjectParams;
227template <
class T,
class Arg>
241 void (T::* func)(const Arg &))
262template <
typename Arg>
ProbeListenerArgBase is used to define the base interface to a ProbeListenerArg (i....
ProbeListenerArgBase(ProbeManager *pm, const std::string &name)
virtual void notify(const Arg &val)=0
ProbeListenerArgFunc generates a listener for the class of Arg and a lambda callback function that is...
ProbeListenerArgFunc(ProbeManager *pm, const std::string &name, const NotifyFunction &func)
std::function< void(const Arg &)> NotifyFunction
void notify(const Arg &val) override
called when the ProbePoint calls notify.
ProbeListenerArg generates a listener for the class of Arg and the class type T which is the class co...
ProbeListenerArg(T *obj, const std::string &name, void(T::*func)(const Arg &))
void(T::* function)(const Arg &)
void notify(const Arg &val) override
called when the ProbePoint calls notify.
This class is a minimal wrapper around SimObject.
ProbeListenerObject(const ProbeListenerObjectParams ¶ms)
ProbeManager * getProbeManager()
virtual ~ProbeListenerObject()
std::vector< ProbeListener * > listeners
ProbeListener base class; here to simplify things like containers containing multiple types of ProbeL...
ProbeListener & operator=(const ProbeListener &other)=delete
ProbeListener & operator=(ProbeListener &&other) noexcept=delete
ProbeListener(ProbeListener &&other) noexcept=delete
ProbeManager *const manager
ProbeListener(ProbeManager *manager, const std::string &name)
ProbeListener(const ProbeListener &other)=delete
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
bool addListener(std::string point_name, ProbeListener &listener)
Add a ProbeListener to the ProbePoint named by pointName.
bool removeListener(std::string point_name, ProbeListener &listener)
Remove a ProbeListener from the ProbePoint named by pointName.
void addPoint(ProbePoint &point)
Add a ProbePoint to this SimObject ProbeManager.
ProbeManager(SimObject *obj)
std::vector< ProbePoint * > points
Vector for name look-up.
GEM5_CLASS_VAR_USED const SimObject * object
Required for sensible debug messages.
ProbePointArg generates a point for the class of Arg.
void addListener(ProbeListener *l) override
adds a ProbeListener to this ProbePoints notify list.
void removeListener(ProbeListener *l) override
remove a ProbeListener from this ProbePoints notify list.
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)
std::vector< ProbeListenerArgBase< Arg > * > listeners
The attached listeners.
ProbeListener base class; again used to simplify use of ProbePoints in containers and used as to defi...
virtual void removeListener(ProbeListener *listener)=0
ProbePoint(ProbeManager *manager, const std::string &name)
virtual void addListener(ProbeListener *listener)=0
std::string getName() const
Abstract superclass for simulation objects.
#define GEM5_CLASS_VAR_USED
const Params & params() const
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.