The Event class allows users to define callbacks that will be executed after a specified delay.
More...
#include <event.h>
|
| | Event (ConfObject *obj, event_class_t *ev) |
| |
| | Event (ConfObject *obj, const std::string &name) |
| |
| void | destroy (void *data) override |
| | Called when the event is removed from the queue without being called.
|
| |
| attr_value_t | get_value (void *data) override |
| | Called to convert the event data into a value that can be saved in a configuration.
|
| |
| void * | set_value (attr_value_t value) override |
| | Called to convert a configuration value into event data.
|
| |
| char * | describe (void *data) const override |
| | Called to generate a human-readable description of the event to be used in the print-event-queue command.
|
| |
| | operator event_class_t * () const |
| |
| virtual | ~EventInterface ()=default |
| |
| virtual void | callback (void *data)=0 |
| | Called when the event expires.
|
| |
| virtual void | destroy (void *data)=0 |
| | Called when the event is removed from the queue without being called.
|
| |
| virtual attr_value_t | get_value (void *data)=0 |
| | Called to convert the event data into a value that can be saved in a configuration.
|
| |
| virtual void * | set_value (attr_value_t value)=0 |
| | Called to convert a configuration value into event data.
|
| |
| virtual char * | describe (void *data) const =0 |
| | Called to generate a human-readable description of the event to be used in the print-event-queue command.
|
| |
|
| template<typename T > |
| T * | device_ptr () const |
| |
| const char * | name () const |
| |
|
| static int | pointer_eq (void *data, void *match_data) |
| |
|
| ConfObject * | obj_ {nullptr} |
| |
| event_class_t * | ev_ {nullptr} |
| |
| conf_object_t * | clock_ {nullptr} |
| | clock_ cannot be initialized here by SIM_object_clock, since attribute queue is not set yet
|
| |
The Event class allows users to define callbacks that will be executed after a specified delay.
The delay can be measured in different units depending on the type of event being created.
Users should inherit from one of the Simics provided classes based on their desired timebase:
◆ Event() [1/2]
| simics::Event::Event |
( |
ConfObject * |
obj, |
|
|
event_class_t * |
ev |
|
) |
| |
- Parameters
-
| obj | should be an instance of the same class the event is registered on |
| ev | should be pointed to the registered Simics event class (e.g., SIM_register_event) |
◆ Event() [2/2]
| simics::Event::Event |
( |
ConfObject * |
obj, |
|
|
const std::string & |
name |
|
) |
| |
- Parameters
-
| name | is the name of the event class registered |
◆ describe()
| char * simics::Event::describe |
( |
void * |
data | ) |
const |
|
overridevirtual |
Called to generate a human-readable description of the event to be used in the print-event-queue command.
Implements simics::EventInterface.
◆ destroy()
| void simics::Event::destroy |
( |
void * |
data | ) |
|
|
overridevirtual |
◆ device_ptr()
template<typename T >
| T * simics::Event::device_ptr |
( |
| ) |
const |
|
inlineprotected |
- Returns
- pointer of the device class instance contains this event instance
◆ get_value()
| attr_value_t simics::Event::get_value |
( |
void * |
data | ) |
|
|
overridevirtual |
Called to convert the event data into a value that can be saved in a configuration.
Implements simics::EventInterface.
◆ name()
| const char * simics::Event::name |
( |
| ) |
const |
|
protected |
◆ operator event_class_t *()
| simics::Event::operator event_class_t * |
( |
| ) |
const |
◆ pointer_eq()
| static int simics::Event::pointer_eq |
( |
void * |
data, |
|
|
void * |
match_data |
|
) |
| |
|
staticprotected |
◆ set_value()
| void * simics::Event::set_value |
( |
attr_value_t |
value | ) |
|
|
overridevirtual |
◆ clock_
| conf_object_t* simics::Event::clock_ {nullptr} |
|
protected |
clock_ cannot be initialized here by SIM_object_clock, since attribute queue is not set yet
◆ ev_
| event_class_t* simics::Event::ev_ {nullptr} |
|
protected |
◆ obj_
The documentation for this class was generated from the following file:
- /disk2/mp/builds/nightly-base.745.16951401086.1/src/devices/c++-api/simics/event.h