C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
after-interface.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2024 Intel Corporation
5
6 This software and the related documents are Intel copyrighted materials, and
7 your use of them is governed by the express license under which they were
8 provided to you ("License"). Unless the License provides otherwise, you may
9 not use, modify, copy, publish, distribute, disclose or transmit this software
10 or the related documents without Intel's prior written permission.
11
12 This software and the related documents are provided as is, with no express or
13 implied warranties, other than those that are expressly stated in the License.
14*/
15
16#ifndef SIMICS_AFTER_INTERFACE_H
17#define SIMICS_AFTER_INTERFACE_H
18
19#include <simics/base/attr-value.h> // attr_value_t
20#include <simics/base/time.h> // cycles_t
21
22#include <string>
23
24namespace simics {
25
26// The interface to operate on a AfterCall
28 public:
29 virtual ~AfterCallInterface() = default;
30 // Return a unique identifier for the function
31 // It consists of the function's name and the typeid string
32 virtual std::string name() const = 0;
33 // Make a copy of the function call
35 // Set arguments for the function call
36 virtual void set_args(const attr_value_t &args) = 0;
37 // Invoke the function with set arguments
38 virtual void invoke() = 0;
39 // Get the function call information as a Simics attribute
40 virtual attr_value_t get_value() = 0;
41};
42
43// Interface used to schedule and cancel after calls
45 public:
46 virtual ~AfterInterface() = default;
47 // Schedules a previously registered callback to be executed after
48 // a specified delay with provided arguments
49 virtual void schedule(double seconds, const std::string &name,
50 const attr_value_t &args) = 0;
51 virtual void schedule(cycles_t cycles, const std::string &name,
52 const attr_value_t &args) = 0;
53 // Cancels all scheduled callbacks
54 virtual void cancel_all() = 0;
55};
56
57} // namespace simics
58
59#endif
Definition: after-interface.h:27
virtual void set_args(const attr_value_t &args)=0
virtual attr_value_t get_value()=0
virtual void invoke()=0
virtual std::string name() const =0
virtual AfterCallInterface * make_copy()=0
virtual ~AfterCallInterface()=default
Definition: after-interface.h:44
virtual void schedule(double seconds, const std::string &name, const attr_value_t &args)=0
virtual void schedule(cycles_t cycles, const std::string &name, const attr_value_t &args)=0
virtual void cancel_all()=0
virtual ~AfterInterface()=default
Definition: after-bank.h:33