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/*
2 © 2014 Intel Corporation
3
4 This software and the related documents are Intel copyrighted materials, and
5 your use of them is governed by the express license under which they were
6 provided to you ("License"). Unless the License provides otherwise, you may
7 not use, modify, copy, publish, distribute, disclose or transmit this software
8 or the related documents without Intel's prior written permission.
9
10 This software and the related documents are provided as is, with no express or
11 implied warranties, other than those that are expressly stated in the License.
12*/
13
14#ifndef SIMICS_SYSTEMC_IFACE_CHECKPOINT_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_CHECKPOINT_SIMICS_ADAPTER_H
16
17#include <simics/simulator-iface/checkpoint.h>
20
21#include <string>
22#include <vector>
23
24namespace simics {
25namespace systemc {
26namespace iface {
27
29template<typename TBase, typename TInterface = CheckpointInterface>
30class CheckpointSimicsAdapter : public SimicsAdapter<checkpoint_interface_t> {
31 public:
33 : SimicsAdapter<checkpoint_interface_t>(
34 CHECKPOINT_INTERFACE, init_iface()) {
35 }
36
37 protected:
38 static void save(conf_object_t *obj, const char *path, save_flags_t flags) {
39 return adapter<TBase, TInterface>(obj)->save(path);
40 }
41 static void finish(conf_object_t *obj, int success) {
42 return adapter<TBase, TInterface>(obj)->finish(success);
43 }
44 static int has_persistent_data(conf_object_t *obj) {
45 return adapter<TBase, TInterface>(obj)->has_persistent_data();
46 }
47
48 private:
49 std::vector<std::string> description(conf_object_t *obj,
50 DescriptionType type) override {
51 return descriptionBase<TBase, TInterface>(obj, type);
52 }
53 checkpoint_interface_t init_iface() {
54 checkpoint_interface_t iface = {};
55 iface.save_v2 = save;
56 iface.finish = finish;
57 iface.has_persistent_data = has_persistent_data;
58 return iface;
59 }
60};
61
62} // namespace iface
63} // namespace systemc
64} // namespace simics
65
66#endif
Adapter for Simics checkpoint interface.
Definition: checkpoint_simics_adapter.h:30
static void save(conf_object_t *obj, const char *path, save_flags_t flags)
Definition: checkpoint_simics_adapter.h:38
static int has_persistent_data(conf_object_t *obj)
Definition: checkpoint_simics_adapter.h:44
CheckpointSimicsAdapter()
Definition: checkpoint_simics_adapter.h:32
static void finish(conf_object_t *obj, int success)
Definition: checkpoint_simics_adapter.h:41
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:45
DescriptionType
Definition: description_interface.h:23
Definition: adapter.h:79