.TH "sc::StateIn" 3 "Sun Oct 4 2020" "Version 2.3.1" "MPQC" \" -*- nroff -*- .ad l .nh .SH NAME sc::StateIn \- Restores objects that derive from \fBSavableState\fP\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBsc::DescribedClass\fP\&. .PP Inherited by \fBsc::MsgStateBufRecv\fP, and \fBsc::StateInFile\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual void \fBget_header\fP ()" .br .RI "Read in the header information\&. " .ti -1c .RI "virtual int \fBversion\fP (const \fBClassDesc\fP *)" .br .RI "Returns the version of the \fBClassDesc\fP in the persistent object or -1 if info on the \fBClassDesc\fP doesn't exist\&. " .ti -1c .RI "virtual int \fBgetstring\fP (char *&)" .br .RI "This restores strings saved with \fBStateOut::putstring\fP\&. " .ti -1c .RI "virtual int \fBget\fP (std::string &)" .br .RI "This restores a std::string object\&. " .ti -1c .RI "virtual int \fBget\fP (char &r, const char *keyword=0)" .br .RI "These restore data saved with \fBStateOut\fP's put\&. members\&. " .ti -1c .RI "virtual int \fBget\fP (unsigned int &r, const char *keyword=0)" .br .ti -1c .RI "virtual int \fBget\fP (int &r, const char *keyword=0)" .br .ti -1c .RI "virtual int \fBget\fP (bool &r, const char *keyword=0)" .br .ti -1c .RI "virtual int \fBget\fP (float &r, const char *keyword=0)" .br .ti -1c .RI "virtual int \fBget\fP (double &r, const char *keyword=0)" .br .ti -1c .RI "virtual int \fBget\fP (char *&)" .br .RI "These restore data saved with \fBStateOut\fP's put\&. " .ti -1c .RI "virtual int \fBget\fP (unsigned int *&)" .br .ti -1c .RI "virtual int \fBget\fP (int *&)" .br .ti -1c .RI "virtual int \fBget\fP (float *&)" .br .ti -1c .RI "virtual int \fBget\fP (double *&)" .br .ti -1c .RI "virtual int \fBget_array_char\fP (char *p, int size)" .br .RI "These restore data saved with \fBStateOut\fP's put\&. " .ti -1c .RI "virtual int \fBget_array_uint\fP (unsigned int *p, int size)" .br .ti -1c .RI "virtual int \fBget_array_int\fP (int *p, int size)" .br .ti -1c .RI "virtual int \fBget_array_float\fP (float *p, int size)" .br .ti -1c .RI "virtual int \fBget_array_double\fP (double *p, int size)" .br .ti -1c .RI "template int \fBget\fP (typename std::vector< T > &v)" .br .RI "Read an STL vector of 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 \fBuse_directory\fP ()" .br .RI "Returns true of this object uses a directory\&. " .ti -1c .RI "virtual int \fBtell\fP ()" .br .RI "Return the current position in the file\&. " .ti -1c .RI "virtual void \fBseek\fP (int)" .br .RI "Set the current position in the file\&. " .ti -1c .RI "virtual int \fBseekable\fP ()" .br .RI "Return non-zero if seek does anything sensible\&. " .ti -1c .RI "int \fBhas_directory\fP () const" .br .ti -1c .RI "virtual void \fBlist_objects\fP (std::ostream &=\fBExEnv::out0\fP())" .br .RI "List all the objects to the stream\&. " .ti -1c .RI "void \fBset_override\fP (const \fBRef\fP< \fBKeyVal\fP > &kv)" .br .RI "Give this \fBStateIn\fP a \fBKeyVal\fP object that is used to override values\&. " .ti -1c .RI "const \fBRef\fP< \fBKeyVal\fP > & \fBoverride\fP () const" .br .RI "Return the \fBKeyVal\fP used to override values\&. " .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual int \fBget_array_void\fP (void *, int)" .br .ti -1c .RI "int \fBpush_key\fP (const char *key)" .br .ti -1c .RI "void \fBpop_key\fP (int n)" .br .ti -1c .RI "const char * \fBkey\fP ()" .br .ti -1c .RI "void \fBget_directory\fP ()" .br .ti -1c .RI "int \fBdirectory_location\fP () const" .br .ti -1c .RI "void \fBfind_and_get_directory\fP ()" .br .ti -1c .RI "virtual int \fBgetobject\fP (\fBRef\fP< \fBSavableState\fP > &)" .br .RI "This is used to restore an object\&. " .ti -1c .RI "virtual int \fBdir_getobject\fP (\fBRef\fP< \fBSavableState\fP > &, const char *name)" .br .RI "This restores objects that are listed in the directory\&. " .ti -1c .RI "virtual void \fBhaveobject\fP (int, const \fBRef\fP< \fBSavableState\fP > &)" .br .RI "When storage has been allocated during object restoration, this routine is called with the object reference number and the pointer to the new storage so getpointer can find the data if it is referenced again\&. " .ti -1c .RI "virtual void \fBnextobject\fP (int)" .br .RI "A call to nextobject followed by havepointer(int) is equiv to havepointer(int,void**);\&. " .ti -1c .RI "virtual void \fBhaveobject\fP (const \fBRef\fP< \fBSavableState\fP > &)" .br .ti -1c .RI "void \fBhave_classdesc\fP ()" .br .ti -1c .RI "int \fBneed_classdesc\fP ()" .br .ti -1c .RI "virtual int \fBget\fP (const \fBClassDesc\fP **)" .br .RI "This restores \fBClassDesc\fP's\&. " .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "\fBRef\fP< \fBKeyVal\fP > \fBoverride_\fP" .br .ti -1c .RI "\fBTranslateDataIn\fP * \fBtranslate_\fP" .br .ti -1c .RI "std::map< int, \fBStateInData\fP > \fBps_\fP" .br .ti -1c .RI "int \fBexpected_object_num_\fP" .br .ti -1c .RI "std::map< \fBClassDescP\fP, int > \fBclassidmap_\fP" .br .ti -1c .RI "std::map< int, \fBStateClassData\fP > \fBclassdatamap_\fP" .br .ti -1c .RI "int \fBnextclassid_\fP" .br .ti -1c .RI "int \fBnode_to_node_\fP" .br .ti -1c .RI "int \fBversion_\fP" .br .ti -1c .RI "int \fBdate_\fP" .br .ti -1c .RI "char \fBuserid_\fP [9]" .br .ti -1c .RI "char \fBformat_\fP" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "class \fBSavableState\fP" .br .ti -1c .RI "class \fBTranslateDataIn\fP" .br .in -1c .SH "Detailed Description" .PP Restores objects that derive from \fBSavableState\fP\&. .SH "Member Function Documentation" .PP .SS "virtual int sc::StateIn::get (char *&)\fC [virtual]\fP" .PP These restore data saved with \fBStateOut\fP's put\&. members\&. The data is allocated by \fBStateIn\fP\&. .PP Reimplemented in \fBsc::StateInText\fP, and \fBsc::MsgStateRecv\fP\&. .SS "virtual int sc::StateIn::get (const \fBClassDesc\fP **)\fC [protected]\fP, \fC [virtual]\fP" .PP This restores \fBClassDesc\fP's\&. It will set the pointer to the address of the static \fBClassDesc\fP for the class which has the same name as the class that had the \fBClassDesc\fP that was saved by put(const ClassDesc*)\&. .PP Reimplemented in \fBsc::StateInText\fP, and \fBsc::MsgStateRecv\fP\&. .PP Referenced by get()\&. .SS "virtual int sc::StateIn::get_array_char (char * p, int size)\fC [virtual]\fP" .PP These restore data saved with \fBStateOut\fP's put\&. members\&. The data must be preallocated by the user\&. .PP Reimplemented in \fBsc::StateInText\fP\&. .SS "virtual void sc::StateIn::get_header ()\fC [virtual]\fP" .PP Read in the header information\&. Changes the translation scheme if necessary\&. .SS "virtual int sc::StateIn::getobject (\fBRef\fP< \fBSavableState\fP > &)\fC [protected]\fP, \fC [virtual]\fP" .PP This is used to restore an object\&. It is called with the reference to the reference being restored\&. If the data being restored has previously been restored, then the pointer being restored is set to a reference to the previously restored object\&. .PP Reimplemented in \fBsc::StateInText\fP\&. .SS "virtual void sc::StateIn::list_objects (std::ostream & = \fC\fBExEnv::out0\fP()\fP)\fC [virtual]\fP" .PP List all the objects to the stream\&. Only \fBStateIn\fP specializations with directories can list objects\&. .SS "int sc::StateIn::node_to_node () const\fC [inline]\fP" .PP True if this is a node to node save/restore\&. This is 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 void sc::StateIn::seek (int)\fC [virtual]\fP" .PP Set the current position in the file\&. The default implementation does nothing\&. .PP Reimplemented in \fBsc::StateInBin\fP, and \fBsc::BcastStateInBin\fP\&. .SS "virtual int sc::StateIn::seekable ()\fC [virtual]\fP" .PP Return non-zero if seek does anything sensible\&. The default implementation returns 0\&. .PP Reimplemented in \fBsc::StateInBin\fP, and \fBsc::BcastStateInBin\fP\&. .SH "Author" .PP Generated automatically by Doxygen for MPQC from the source code\&.