The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::pevents::PEvent< CustomAttrs > Class Template Reference

Defines the class base type for PEvents. More...

#include <PEventHelper.hpp>

Public Member Functions

template<typename ... ArgNames>
 PEvent (const std::string &name, log::MessageSource &logger, const Clock *clk, ArgNames &&... names)
 
void setName (const std::string &name)
 
void setFormatFlags (const uint32_t n, const FormatFlags &pre_flag, const FormatFlags &post_flag, const std::string &pre, const std::string &post)
 
void setFormatFlags (const uint32_t n, const std::string &pre, const std::string &post)
 
void setFormatLength (const uint32_t n, const int length, const FormatFlags &align, const char fill)
 
void setAsStrings (const std::initializer_list< uint32_t > list)
 set many attributes as strings, \usage setAsString({1,3,5}); //where 1, 3, and 5 are attributes to be set as a string.
 
void setAsHex (const std::initializer_list< uint32_t > &list)
 a helper to set a custom attribute to be outputted in hex format. \usage setAsHex({1, 2, 3}); //will set custom attributes 1, 2, 3 as hex displayed outputs
 
void setAttrs (CustomAttrs... attrs)
 
template<typename AttrType , uint32_t N>
void setAttr (const AttrType &attr)
 
void fireEvent ()
 
void fireEvent (CustomAttrs... attrs)
 Maybe overload fireEvent to allow setting the attributes when firing.
 
bool observed ()
 

Detailed Description

template<typename ... CustomAttrs>
class sparta::pevents::PEvent< CustomAttrs >

Defines the class base type for PEvents.

Do not use this class directly. Instead, use a sparta::pevents::PeventCollector object instead.

Definition at line 87 of file PEventHelper.hpp.

Constructor & Destructor Documentation

◆ PEvent()

template<typename ... CustomAttrs>
template<typename ... ArgNames>
sparta::pevents::PEvent< CustomAttrs >::PEvent ( const std::string &  name,
log::MessageSource logger,
const Clock clk,
ArgNames &&...  names 
)
inline

Would set the event_type, as well as initial values for custom attrs Set the custom attribute names. We can probably create our own logger? But maybe they want to use the same logger for all these events?

Definition at line 204 of file PEventHelper.hpp.

Member Function Documentation

◆ fireEvent() [1/2]

template<typename ... CustomAttrs>
void sparta::pevents::PEvent< CustomAttrs >::fireEvent ( )
inline

Maybe it would be worth allowing some ability to have this PEvent instance query objects for attribute data... I don't know where the PEvent data is actually coming from? I guess we will need some way to alert the PEvent that it has occured? This is where the event would be dumped?

do what ever else the Pevent needs to do such as notifying observers?

Examples
/github/workspace/sparta/sparta/pevents/PEventHelper.hpp.

Definition at line 316 of file PEventHelper.hpp.

◆ fireEvent() [2/2]

template<typename ... CustomAttrs>
void sparta::pevents::PEvent< CustomAttrs >::fireEvent ( CustomAttrs...  attrs)
inline

Maybe overload fireEvent to allow setting the attributes when firing.

Definition at line 346 of file PEventHelper.hpp.

◆ observed()

template<typename ... CustomAttrs>
bool sparta::pevents::PEvent< CustomAttrs >::observed ( )
inline

Definition at line 352 of file PEventHelper.hpp.

◆ setAsHex()

template<typename ... CustomAttrs>
void sparta::pevents::PEvent< CustomAttrs >::setAsHex ( const std::initializer_list< uint32_t > &  list)
inline

a helper to set a custom attribute to be outputted in hex format. \usage setAsHex({1, 2, 3}); //will set custom attributes 1, 2, 3 as hex displayed outputs

Examples
/github/workspace/sparta/sparta/pevents/PEventHelper.hpp.

Definition at line 288 of file PEventHelper.hpp.

◆ setAsStrings()

template<typename ... CustomAttrs>
void sparta::pevents::PEvent< CustomAttrs >::setAsStrings ( const std::initializer_list< uint32_t >  list)
inline

set many attributes as strings, \usage setAsString({1,3,5}); //where 1, 3, and 5 are attributes to be set as a string.

Examples
/github/workspace/sparta/sparta/pevents/PEventHelper.hpp.

Definition at line 276 of file PEventHelper.hpp.

◆ setAttr()

template<typename ... CustomAttrs>
template<typename AttrType , uint32_t N>
void sparta::pevents::PEvent< CustomAttrs >::setAttr ( const AttrType &  attr)
inline

Set individual attributes? Would be cool if we could so some weirdness to set attribute by name... maybe some macro magic.

Examples
/github/workspace/sparta/sparta/pevents/PEventHelper.hpp.

Definition at line 309 of file PEventHelper.hpp.

◆ setAttrs()

template<typename ... CustomAttrs>
void sparta::pevents::PEvent< CustomAttrs >::setAttrs ( CustomAttrs...  attrs)
inline

We probably need a way to set the attributes dynamically? Or would we rather set them every fireEvent? Or would the attributes not change? Is something like this sufficient?

Examples
/github/workspace/sparta/sparta/pevents/PEventHelper.hpp.

Definition at line 304 of file PEventHelper.hpp.

◆ setFormatFlags() [1/2]

template<typename ... CustomAttrs>
void sparta::pevents::PEvent< CustomAttrs >::setFormatFlags ( const uint32_t  n,
const FormatFlags &  pre_flag,
const FormatFlags &  post_flag,
const std::string &  pre,
const std::string &  post 
)
inline

Definition at line 240 of file PEventHelper.hpp.

◆ setFormatFlags() [2/2]

template<typename ... CustomAttrs>
void sparta::pevents::PEvent< CustomAttrs >::setFormatFlags ( const uint32_t  n,
const std::string &  pre,
const std::string &  post 
)
inline

Definition at line 251 of file PEventHelper.hpp.

◆ setFormatLength()

template<typename ... CustomAttrs>
void sparta::pevents::PEvent< CustomAttrs >::setFormatLength ( const uint32_t  n,
const int  length,
const FormatFlags &  align,
const char  fill 
)
inline

Definition at line 263 of file PEventHelper.hpp.

◆ setName()

template<typename ... CustomAttrs>
void sparta::pevents::PEvent< CustomAttrs >::setName ( const std::string &  name)
inline

Definition at line 220 of file PEventHelper.hpp.


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