serialize.hh (12450:b5a0300fc327) serialize.hh (12452:ad4adeb441d0)
1/*
2 * Copyright (c) 2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 58 unchanged lines hidden (view full) ---

67class SimObjectResolver;
68
69typedef std::ostream CheckpointOut;
70
71
72template <class T>
73void paramOut(CheckpointOut &cp, const std::string &name, const T &param);
74
1/*
2 * Copyright (c) 2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 58 unchanged lines hidden (view full) ---

67class SimObjectResolver;
68
69typedef std::ostream CheckpointOut;
70
71
72template <class T>
73void paramOut(CheckpointOut &cp, const std::string &name, const T &param);
74
75template <typename BitUnion>
76void paramOut(CheckpointOut &cp, const std::string &name,
77 const BitfieldBackend::BitUnionOperators<BitUnion> &p)
75template <typename T>
76void
77paramOut(CheckpointOut &cp, const std::string &name, const BitUnionType<T> &p)
78{
78{
79 paramOut(cp, name, p.__storage);
79 paramOut(cp, name, static_cast<BitUnionBaseType<T> >(p));
80}
81
82template <class T>
83void paramIn(CheckpointIn &cp, const std::string &name, T &param);
84
80}
81
82template <class T>
83void paramIn(CheckpointIn &cp, const std::string &name, T &param);
84
85template <typename BitUnion>
86void paramIn(CheckpointIn &cp, const std::string &name,
87 BitfieldBackend::BitUnionOperators<BitUnion> &p)
85template <typename T>
86void
87paramIn(CheckpointIn &cp, const std::string &name, BitUnionType<T> &p)
88{
88{
89 paramIn(cp, name, p.__storage);
89 BitUnionBaseType<T> b;
90 paramIn(cp, name, b);
91 p = b;
90}
91
92template <class T>
93bool optParamIn(CheckpointIn &cp, const std::string &name, T &param,
94 bool warn = true);
95
92}
93
94template <class T>
95bool optParamIn(CheckpointIn &cp, const std::string &name, T &param,
96 bool warn = true);
97
96template <typename BitUnion>
97bool optParamIn(CheckpointIn &cp, const std::string &name,
98 BitfieldBackend::BitUnionOperators<BitUnion> &p,
99 bool warn = true)
98template <typename T>
99bool
100optParamIn(CheckpointIn &cp, const std::string &name,
101 BitUnionType<T> &p, bool warn = true)
100{
102{
101 return optParamIn(cp, name, p.__storage, warn);
103 BitUnionBaseType<T> b;
104 if (optParamIn(cp, name, b, warn)) {
105 p = b;
106 return true;
107 } else {
108 return false;
109 }
102}
103
104template <class T>
105void arrayParamOut(CheckpointOut &cp, const std::string &name,
106 const T *param, unsigned size);
107
108template <class T>
109void arrayParamOut(CheckpointOut &cp, const std::string &name,

--- 282 unchanged lines hidden ---
110}
111
112template <class T>
113void arrayParamOut(CheckpointOut &cp, const std::string &name,
114 const T *param, unsigned size);
115
116template <class T>
117void arrayParamOut(CheckpointOut &cp, const std::string &name,

--- 282 unchanged lines hidden ---