serialize.hh (10453:d0365cc3d05f) serialize.hh (10459:810f5a48a920)
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

38#define __SERIALIZE_HH__
39
40
41#include <iostream>
42#include <list>
43#include <map>
44#include <vector>
45
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

38#define __SERIALIZE_HH__
39
40
41#include <iostream>
42#include <list>
43#include <map>
44#include <vector>
45
46#include "base/bitunion.hh"
46#include "base/types.hh"
47
48class IniFile;
49class Serializable;
50class Checkpoint;
51class SimObject;
52class EventQueue;
53

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

58 * SimObject shouldn't cause the version number to increase, only changes to
59 * existing objects such as serializing/unserializing more state, changing sizes
60 * of serialized arrays, etc. */
61static const uint64_t gem5CheckpointVersion = 0x000000000000000d;
62
63template <class T>
64void paramOut(std::ostream &os, const std::string &name, const T &param);
65
47#include "base/types.hh"
48
49class IniFile;
50class Serializable;
51class Checkpoint;
52class SimObject;
53class EventQueue;
54

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

59 * SimObject shouldn't cause the version number to increase, only changes to
60 * existing objects such as serializing/unserializing more state, changing sizes
61 * of serialized arrays, etc. */
62static const uint64_t gem5CheckpointVersion = 0x000000000000000d;
63
64template <class T>
65void paramOut(std::ostream &os, const std::string &name, const T &param);
66
67template <typename DataType, typename BitUnion>
68void paramOut(std::ostream &os, const std::string &name,
69 const BitfieldBackend::BitUnionOperators<DataType, BitUnion> &p)
70{
71 paramOut(os, name, p.__data);
72}
73
66template <class T>
67void paramIn(Checkpoint *cp, const std::string &section,
68 const std::string &name, T &param);
69
74template <class T>
75void paramIn(Checkpoint *cp, const std::string &section,
76 const std::string &name, T &param);
77
78template <typename DataType, typename BitUnion>
79void paramIn(Checkpoint *cp, const std::string &section,
80 const std::string &name,
81 BitfieldBackend::BitUnionOperators<DataType, BitUnion> &p)
82{
83 paramIn(cp, section, name, p.__data);
84}
85
70template <class T>
71bool optParamIn(Checkpoint *cp, const std::string &section,
72 const std::string &name, T &param);
73
86template <class T>
87bool optParamIn(Checkpoint *cp, const std::string &section,
88 const std::string &name, T &param);
89
90template <typename DataType, typename BitUnion>
91bool optParamIn(Checkpoint *cp, const std::string &section,
92 const std::string &name,
93 BitfieldBackend::BitUnionOperators<DataType, BitUnion> &p)
94{
95 return optParamIn(cp, section, name, p.__data);
96}
97
74template <class T>
75void arrayParamOut(std::ostream &os, const std::string &name,
76 const T *param, unsigned size);
77
78template <class T>
79void arrayParamOut(std::ostream &os, const std::string &name,
80 const std::vector<T> &param);
81

--- 238 unchanged lines hidden ---
98template <class T>
99void arrayParamOut(std::ostream &os, const std::string &name,
100 const T *param, unsigned size);
101
102template <class T>
103void arrayParamOut(std::ostream &os, const std::string &name,
104 const std::vector<T> &param);
105

--- 238 unchanged lines hidden ---