.TH "sc::StateOut" 3 "Sun Oct 4 2020" "Version 2.3.1" "MPQC" \" -*- nroff -*- .ad l .nh .SH NAME sc::StateOut \- Serializes objects that derive from \fBSavableState\fP\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBsc::DescribedClass\fP\&. .PP Inherited by \fBsc::MsgStateSend\fP, and \fBsc::StateOutFile\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual void \fBput_header\fP ()" .br .RI "Write out header information\&. " .ti -1c .RI "virtual int \fBputstring\fP (const char *)" .br .RI "This is like put except the length of the char array is determined by interpreting the character array as a character string\&. " .ti -1c .RI "virtual int \fBput\fP (const std::string &)" .br .RI "Write out a std::string object\&. " .ti -1c .RI "virtual int \fBput\fP (char r)" .br .RI "Write the given datum\&. " .ti -1c .RI "virtual int \fBput\fP (unsigned int r)" .br .ti -1c .RI "virtual int \fBput\fP (int r)" .br .ti -1c .RI "virtual int \fBput\fP (bool r)" .br .ti -1c .RI "virtual int \fBput\fP (unsigned long r)" .br .ti -1c .RI "virtual int \fBput\fP (float r)" .br .ti -1c .RI "virtual int \fBput\fP (double r)" .br .ti -1c .RI "virtual int \fBput\fP (const char *, int)" .br .RI "Write the given array data\&. " .ti -1c .RI "virtual int \fBput\fP (const unsigned int *, int)" .br .ti -1c .RI "virtual int \fBput\fP (const int *, int)" .br .ti -1c .RI "virtual int \fBput\fP (const float *, int)" .br .ti -1c .RI "virtual int \fBput\fP (const double *, int)" .br .ti -1c .RI "virtual int \fBput_array_char\fP (const char *p, int size)" .br .RI "Put arrays of data\&. " .ti -1c .RI "virtual int \fBput_array_uint\fP (const unsigned int *p, int size)" .br .ti -1c .RI "virtual int \fBput_array_int\fP (const int *p, int size)" .br .ti -1c .RI "virtual int \fBput_array_float\fP (const float *p, int size)" .br .ti -1c .RI "virtual int \fBput_array_double\fP (const double *p, int size)" .br .ti -1c .RI "template int \fBput\fP (typename std::vector< T > &v)" .br .RI "Write an STL vector of data\&. " .ti -1c .RI "void \fBforget_references\fP ()" .br .RI "Don't keep track of pointers to objects\&. " .ti -1c .RI "void \fBcopy_references\fP ()" .br .RI "If a reference to an object that has already been written is encountered, copy it instead of generating a reference to the first object\&. " .ti -1c .RI "virtual int \fBuse_directory\fP ()" .br .RI "Returns true if this object uses a directory\&. " .ti -1c .RI "virtual void \fBflush\fP ()" .br .RI "Flush out any remaining data\&. " .ti -1c .RI "int \fBnode_to_node\fP () const" .br .RI "True if this is a node to node save/restore\&. " .ti -1c .RI "virtual int \fBtell\fP ()" .br .RI "Returns the current position in the file\&. " .ti -1c .RI "virtual void \fBseek\fP (int loc)" .br .RI "Set the current position in the file\&. " .ti -1c .RI "virtual int \fBseekable\fP ()" .br .RI "Return non-zero if tell and seek do anything sensible\&. " .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual int \fBput_array_void\fP (const void *, int)" .br .ti -1c .RI "virtual int \fBputparents\fP (const \fBClassDesc\fP *)" .br .ti -1c .RI "void \fBput_directory\fP ()" .br .ti -1c .RI "void \fBhave_classdesc\fP ()" .br .ti -1c .RI "int \fBneed_classdesc\fP ()" .br .ti -1c .RI "virtual int \fBputobject\fP (const \fBRef\fP< \fBSavableState\fP > &)" .br .RI "This will prepare \fBStateOut\fP to output a pointer to data\&. " .ti -1c .RI "virtual int \fBput\fP (const \fBClassDesc\fP *)" .br .RI "Write out information about the given \fBClassDesc\fP\&. " .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "int \fBdir_loc_loc_\fP" .br .ti -1c .RI "\fBTranslateDataOut\fP * \fBtranslate_\fP" .br .ti -1c .RI "int \fBcopy_references_\fP" .br .ti -1c .RI "int \fBnext_object_number_\fP" .br .ti -1c .RI "std::map< \fBRef\fP< \fBSavableState\fP >, \fBStateOutData\fP > \fBps_\fP" .br .ti -1c .RI "std::map< \fBClassDescP\fP, int > \fBclassidmap_\fP" .br .ti -1c .RI "int \fBnextclassid_\fP" .br .ti -1c .RI "int \fBnode_to_node_\fP" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "class \fBSavableState\fP" .br .ti -1c .RI "class \fBTranslateDataOut\fP" .br .in -1c .SH "Detailed Description" .PP Serializes objects that derive from \fBSavableState\fP\&. \fBStateOut\fP keeps track of pointers to data so that two references to the same piece of data do not result in that data being sent to the output device two times\&. .SH "Member Function Documentation" .PP .SS "void sc::StateOut::copy_references ()" .PP If a reference to an object that has already been written is encountered, copy it instead of generating a reference to the first object\&. The directory will not be updated with new objects\&. .SS "void sc::StateOut::forget_references ()" .PP Don't keep track of pointers to objects\&. Calling this causes duplicated references to objects to be copied\&. The directory will not contain the forgotten objects\&. .SS "int sc::StateOut::node_to_node () const\fC [inline]\fP" .PP True if this is a node to node save/restore\&. This is necessary for classes that try to avoid saving databases to files that can otherwise be read in, but want to avoid reading the database from disk on all nodes\&. .SS "virtual int sc::StateOut::put (const char *, int)\fC [virtual]\fP" .PP Write the given array data\&. Size information is also saved\&. The data is allocated and read by the get(T*&) routines\&. .PP Reimplemented in \fBsc::StateOutText\fP, and \fBsc::MsgStateSend\fP\&. .SS "virtual int sc::StateOut::put_array_char (const char * p, int size)\fC [virtual]\fP" .PP Put arrays of data\&. No size information is stored\&. This data is read by the get_array_T routines\&. .PP Reimplemented in \fBsc::StateOutText\fP\&. .SS "virtual int sc::StateOut::putobject (const \fBRef\fP< \fBSavableState\fP > &)\fC [protected]\fP, \fC [virtual]\fP" .PP This will prepare \fBStateOut\fP to output a pointer to data\&. It first checks to see if the data has already been saved\&. If it has, then a reference to this data is saved\&. Otherwise the object is written out\&. .PP Reimplemented in \fBsc::StateOutText\fP\&. .SS "virtual void sc::StateOut::seek (int loc)\fC [virtual]\fP" .PP Set the current position in the file\&. The default implementation does nothing\&. .PP Reimplemented in \fBsc::StateOutBin\fP\&. .SS "virtual int sc::StateOut::seekable ()\fC [virtual]\fP" .PP Return non-zero if tell and seek do anything sensible\&. The default implementation returns 0\&. .PP Reimplemented in \fBsc::StateOutBin\fP\&. .SS "virtual int sc::StateOut::tell ()\fC [virtual]\fP" .PP Returns the current position in the file\&. The default implementation returns 0\&. .PP Reimplemented in \fBsc::StateOutBin\fP\&. .SH "Author" .PP Generated automatically by Doxygen for MPQC from the source code\&.