gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::ProbeListenerArgFunc< Arg > Class Template Reference

ProbeListenerArgFunc generates a listener for the class of Arg and a lambda callback function that is called by the notify. More...

#include <probe.hh>

Inheritance diagram for gem5::ProbeListenerArgFunc< Arg >:
gem5::ProbeListenerArgBase< Arg > gem5::ProbeListener

Public Member Functions

 ProbeListenerArgFunc (ProbeManager *pm, const std::string &name, const NotifyFunction &func)
 
void notify (const Arg &val) override
 called when the ProbePoint calls notify.
 
- Public Member Functions inherited from gem5::ProbeListenerArgBase< Arg >
 ProbeListenerArgBase (ProbeManager *pm, const std::string &name)
 
- Public Member Functions inherited from gem5::ProbeListener
 ProbeListener (ProbeManager *manager, const std::string &name)
 
virtual ~ProbeListener ()
 
 ProbeListener (const ProbeListener &other)=delete
 
ProbeListeneroperator= (const ProbeListener &other)=delete
 
 ProbeListener (ProbeListener &&other) noexcept=delete
 
ProbeListeneroperator= (ProbeListener &&other) noexcept=delete
 

Private Types

typedef std::function< void(const Arg &)> NotifyFunction
 

Private Attributes

NotifyFunction function
 

Additional Inherited Members

- Protected Attributes inherited from gem5::ProbeListener
ProbeManager *const manager
 
const std::string name
 

Detailed Description

template<class Arg>
class gem5::ProbeListenerArgFunc< Arg >

ProbeListenerArgFunc generates a listener for the class of Arg and a lambda callback function that is called by the notify.

Note that the function is passed as lambda function on construction Example: ProbeListenerArgFunc<MyArg> (myobj->getProbeManager(), "MyProbePointName", [this](const MyArg &arg) { my_own_func(arg, xyz...); // do something with arg }));

Definition at line 334 of file probe.hh.

Member Typedef Documentation

◆ NotifyFunction

template<class Arg >
typedef std::function<void(const Arg &)> gem5::ProbeListenerArgFunc< Arg >::NotifyFunction
private

Definition at line 336 of file probe.hh.

Constructor & Destructor Documentation

◆ ProbeListenerArgFunc()

template<class Arg >
gem5::ProbeListenerArgFunc< Arg >::ProbeListenerArgFunc ( ProbeManager * pm,
const std::string & name,
const NotifyFunction & func )
inline
Parameters
objthe class of type Tcontaining the method to call on notify.
pmA probe manager that is not part of the obj
namethe name of the ProbePoint to add this listener to.
funca pointer to the function on obj (called on notify).

Definition at line 347 of file probe.hh.

Member Function Documentation

◆ notify()

template<class Arg >
void gem5::ProbeListenerArgFunc< Arg >::notify ( const Arg & val)
inlineoverridevirtual

called when the ProbePoint calls notify.

This is a shim through to the function passed during construction.

Parameters
valthe argument value to pass.

Implements gem5::ProbeListenerArgBase< Arg >.

Definition at line 358 of file probe.hh.

References gem5::ProbeListenerArgFunc< Arg >::function, and gem5::X86ISA::val.

Member Data Documentation

◆ function

template<class Arg >
NotifyFunction gem5::ProbeListenerArgFunc< Arg >::function
private

Definition at line 338 of file probe.hh.

Referenced by gem5::ProbeListenerArgFunc< Arg >::notify().


The documentation for this class was generated from the following file:

Generated on Tue Jun 18 2024 16:24:13 for gem5 by doxygen 1.11.0