28#ifndef _util_state_stateout_h
29#define _util_state_stateout_h
39#include <util/class/class.h>
40#include <util/state/state.h>
73 int next_object_number_;
75 std::map<ClassDescP,int> classidmap_;
78 virtual int put_array_void(
const void*,
int);
85 void have_classdesc() { have_cd_ = 1; }
86 int need_classdesc() {
int tmp = have_cd_; have_cd_ = 0;
return !tmp; }
108 virtual int put(
const std::string &);
112 virtual int put(
unsigned int r);
113 virtual int put(
int r);
114 virtual int put(
bool r);
115 virtual int put(
unsigned long r);
116 virtual int put(
float r);
117 virtual int put(
double r);
120 virtual int put(
const char*,
int);
121 virtual int put(
const unsigned int*,
int);
122 virtual int put(
const int*,
int);
123 virtual int put(
const float*,
int);
124 virtual int put(
const double*,
int);
128 virtual int put_array_uint(
const unsigned int*p,
int size);
129 virtual int put_array_int(
const int*p,
int size);
130 virtual int put_array_float(
const float*p,
int size);
131 virtual int put_array_double(
const double*p,
int size);
135 int put(
typename std::vector<T> &v) {
138 if (l) {
for (
int i=0; i<l; i++) r +=
put(v[i]); }
This class is used to contain information about classes.
Definition: class.h:158
Classes which need runtime information about themselves and their relationship to other classes can v...
Definition: class.h:244
A template class that maintains references counts.
Definition: ref.h:332
Base class for objects that can save/restore state.
Definition: state.h:46
Definition: stateout.h:44
Serializes objects that derive from SavableState.
Definition: stateout.h:61
void copy_references()
If a reference to an object that has already been written is encountered, copy it instead of generati...
virtual void flush()
Flush out any remaining data.
int node_to_node() const
True if this is a node to node save/restore.
Definition: stateout.h:162
virtual int put_array_char(const char *p, int size)
Put arrays of data.
virtual int put(char r)
Write the given datum.
virtual int tell()
Returns the current position in the file.
virtual int putstring(const char *)
This is like put except the length of the char array is determined by interpreting the character arra...
int put(typename std::vector< T > &v)
Write an STL vector of data.
Definition: stateout.h:135
virtual void put_header()
Write out header information.
virtual int use_directory()
Returns true if this object uses a directory.
void forget_references()
Don't keep track of pointers to objects.
virtual int seekable()
Return non-zero if tell and seek do anything sensible.
virtual int put(const ClassDesc *)
Write out information about the given ClassDesc.
virtual int put(const char *, int)
Write the given array data.
virtual int put(const std::string &)
Write out a std::string object.
virtual int putobject(const Ref< SavableState > &)
This will prepare StateOut to output a pointer to data.
virtual void seek(int loc)
Set the current position in the file.
Convert data to other formats.
Definition: translate.h:154