SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
checkpoint_simics_adapter.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2014 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_SYSTEMC_IFACE_CHECKPOINT_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_CHECKPOINT_SIMICS_ADAPTER_H
18
19#include <simics/simulator-iface/checkpoint.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29
31template<typename TBase, typename TInterface = CheckpointInterface>
32class CheckpointSimicsAdapter : public SimicsAdapter<checkpoint_interface_t> {
33 public:
35 : SimicsAdapter<checkpoint_interface_t>(
36 CHECKPOINT_INTERFACE, init_iface()) {
37 }
38
39 protected:
40 static void save(conf_object_t *obj, const char *path) {
41 return adapter<TBase, TInterface>(obj)->save(path);
42 }
43 static void finish(conf_object_t *obj, int success) {
44 return adapter<TBase, TInterface>(obj)->finish(success);
45 }
46 static int has_persistent_data(conf_object_t *obj) {
47 return adapter<TBase, TInterface>(obj)->has_persistent_data();
48 }
49
50 private:
51 std::vector<std::string> description(conf_object_t *obj,
52 DescriptionType type) {
53 return descriptionBase<TBase, TInterface>(obj, type);
54 }
55 checkpoint_interface_t init_iface() {
56 checkpoint_interface_t iface = {};
57 iface.save = save;
58 iface.finish = finish;
59 iface.has_persistent_data = has_persistent_data;
60 return iface;
61 }
62};
63
64} // namespace iface
65} // namespace systemc
66} // namespace simics
67
68#endif
Adapter for Simics checkpoint interface.
Definition: checkpoint_simics_adapter.h:32
static void save(conf_object_t *obj, const char *path)
Definition: checkpoint_simics_adapter.h:40
static int has_persistent_data(conf_object_t *obj)
Definition: checkpoint_simics_adapter.h:46
CheckpointSimicsAdapter()
Definition: checkpoint_simics_adapter.h:34
static void finish(conf_object_t *obj, int success)
Definition: checkpoint_simics_adapter.h:43
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:47
DescriptionType
Definition: description_interface.h:25
Definition: pci_bus_interface.h:24