MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
state.h
1//
2// state.h
3//
4// Copyright (C) 1996 Limit Point Systems, Inc.
5//
6// Author: Curtis Janssen <cljanss@limitpt.com>
7// Maintainer: LPS
8//
9// This file is part of the SC Toolkit.
10//
11// The SC Toolkit is free software; you can redistribute it and/or modify
12// it under the terms of the GNU Library General Public License as published by
13// the Free Software Foundation; either version 2, or (at your option)
14// any later version.
15//
16// The SC Toolkit is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU Library General Public License for more details.
20//
21// You should have received a copy of the GNU Library General Public License
22// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24//
25// The U.S. Government is granted a limited license as per AL 91-7.
26//
27
28#ifndef _util_state_state_h
29#define _util_state_state_h
30
31#include <util/class/class.h>
32
33namespace sc {
34
35class StateIn;
36class StateOut;
37class TranslateDataIn;
38class TranslateDataOut;
39
42
45class SavableState: virtual public DescribedClass {
46 protected:
49#ifndef __GNUC__
50 public:
51#endif
52 SavableState& operator=(const SavableState&);
53 public:
54 virtual ~SavableState();
55
56 // save functions
57
64
65 // Like save_state(StateOut&), but will handle null pointers correctly.
66 static void save_state(SavableState*s, StateOut&);
67
73
81 virtual void save_vbase_state(StateOut&);
82
86 virtual void save_data_state(StateOut&);
87
88 // restore functions
89
101 const char *keyword);
102 static SavableState* dir_restore_state(StateIn& si,
103 const char *objectname,
104 const char *keyword = 0);
105
106 protected:
107
113 };
114
116 struct DummySavableState : virtual public SavableState {
117 public:
119
123
124 private:
125 static ClassDesc class_desc_;
126 };
127
129// end of addgroup State
130
131}
132
133#endif
134
135// Local Variables:
136// mode: c++
137// c-file-style: "CLJ"
138// End:
This class is used to contain information about classes.
Definition class.h:147
Classes which need runtime information about themselves and their relationship to other classes can v...
Definition class.h:233
Base class for objects that can save/restore state.
Definition state.h:45
virtual void save_vbase_state(StateOut &)
Save the virtual bases for the object.
SavableState(StateIn &)
Each derived class StateIn CTOR handles the restore corresponding to calling save_object_state,...
void save_object_state(StateOut &)
This can be used for saving state when the exact type of the object is known for both the save and th...
static SavableState * key_restore_state(StateIn &si, const char *keyword)
Like restore_state, but keyword is used to override values while restoring.
static SavableState * restore_state(StateIn &si)
Restores objects saved with save_state.
virtual void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void save_state(StateOut &)
Save the state of the object as specified by the StateOut object.
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
Contains all MPQC code up to version 3.
Definition mpqcin.h:14
useful as a dummy template argument
Definition state.h:116
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...

Generated at Wed Sep 25 2024 02:45:31 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.