sc::StateIn(3)

πŸ“¦
version 2.3.1 Β· 5 versions
, in ubuntu jammy

πŸ¦‹ NAME πŸ¦‹

okay so this is the sc::StateIn(3) manual page, MPQC edition β€” and sc::StateIn is literally the class that restores objects that derive from SavableState. that's the whole name section, bestie. πŸ’…


✨ SYNOPSIS ✨

#include <statein.h>

Inherits sc::DescribedClass.

Inherited by sc::MsgStateBufRecv, and sc::StateInFile.

πŸ’– Public Member Functions πŸ’–

  • virtual void get_header () β€” reads in the header information.
  • virtual int version (const ClassDesc *) β€” returns the version of the ClassDesc in the persistent object, or -1 if there's no info on the ClassDesc. no cap, that -1 is doing its thing. 🫢
  • virtual int getstring (char *&) β€” restores strings saved with StateOut::putstring.
  • virtual int get (std::string &) β€” restores a std::string object.
  • virtual int get (char &r, const char *keyword=0) β€” restores data saved with StateOut's put members.
  • virtual int get (unsigned int &r, const char *keyword=0) β€” restores data saved with StateOut's put members.
  • virtual int get (int &r, const char *keyword=0) β€” restores data saved with StateOut's put members.
  • virtual int get (bool &r, const char *keyword=0) β€” restores data saved with StateOut's put members.
  • virtual int get (float &r, const char *keyword=0) β€” restores data saved with StateOut's put members.
  • virtual int get (double &r, const char *keyword=0) β€” restores data saved with StateOut's put members.
  • virtual int get (char *&) β€” restores data saved with StateOut's put.
  • virtual int get (unsigned int *&) β€” restores data saved with StateOut's put.
  • virtual int get (int *&) β€” restores data saved with StateOut's put.
  • virtual int get (float *&) β€” restores data saved with StateOut's put.
  • virtual int get (double *&) β€” restores data saved with StateOut's put.
  • virtual int get_array_char (char *p, int size) β€” restores data saved with StateOut's put.
  • virtual int get_array_uint (unsigned int *p, int size) β€” restores data saved with StateOut's put.
  • virtual int get_array_int (int *p, int size) β€” restores data saved with StateOut's put.
  • virtual int get_array_float (float *p, int size) β€” restores data saved with StateOut's put.
  • virtual int get_array_double (double *p, int size) β€” restores data saved with StateOut's put.
  • template<class T > int get (typename std::vector< T > &v) β€” reads an STL vector of data. cute. 🌸
  • int node_to_node () const β€” true if this is a node to node save/restore.
  • virtual int use_directory () β€” returns true if this object uses a directory.
  • virtual int tell () β€” returns the current position in the file.
  • virtual void seek (int) β€” sets the current position in the file.
  • virtual int seekable () β€” returns non-zero if seek does anything sensible.
  • int has_directory () const β€” the page gives this one no description, so we're not inventing one, bestie. πŸ’€
  • virtual void list_objects (std::ostream &=ExEnv::out0()) β€” lists all the objects to the stream.
  • void set_override (const Ref< KeyVal > &kv) β€” gives this StateIn a KeyVal object that is used to override values.
  • const Ref< KeyVal > & override () const β€” returns the KeyVal used to override values.

πŸŽ€ Protected Member Functions πŸŽ€

  • virtual int get_array_void (void *, int) β€” no description on the page. it's just there, being mysterious. πŸ™ˆ
  • int push_key (const char *key) β€” no description on the page.
  • void pop_key (int n) β€” no description on the page.
  • const char * key () β€” no description on the page.
  • void get_directory () β€” no description on the page.
  • int directory_location () const β€” no description on the page.
  • void find_and_get_directory () β€” no description on the page.
  • virtual int getobject (Ref< SavableState > &) β€” used to restore an object.
  • virtual int dir_getobject (Ref< SavableState > &, const char *name) β€” restores objects that are listed in the directory.
  • virtual void haveobject (int, const Ref< SavableState > &) β€” 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.
  • virtual void nextobject (int) β€” a call to nextobject followed by havepointer(int) is equiv to havepointer(int,void**);. yes, that semicolon is invited to the function call. πŸ’…
  • virtual void haveobject (const Ref< SavableState > &) β€” no description on the page.
  • void have_classdesc () β€” no description on the page.
  • int need_classdesc () β€” no description on the page.
  • virtual int get (const ClassDesc **) β€” this restores ClassDesc's.

🧚 Protected Attributes 🧚

  • Ref< KeyVal > override_
  • TranslateDataIn * translate_
  • std::map< int, StateInData > ps_
  • int expected_object_num_
  • std::map< ClassDescP, int > classidmap_
  • std::map< int, StateClassData > classdatamap_
  • int nextclassid_
  • int node_to_node_
  • int version_
  • int date_
  • char userid_ [9]
  • char format_

πŸ‘― Friends πŸ‘―

  • class SavableState
  • class TranslateDataIn

πŸ’– Detailed Description πŸ’–

sc::StateIn restores objects that derive from SavableState. that's the whole detailed description, and honestly? iconic. ✨


πŸ”₯ Member Function Documentation πŸ”₯

πŸ’… virtual int sc::StateIn::get (char *&) [virtual]

these restore data saved with StateOut's put members β€” and the data is allocated by StateIn. yes bestie, StateIn handles the allocation here. 🫢

Reimplemented in sc::MsgStateRecv, and sc::StateInText.

πŸ’… virtual int sc::StateIn::get (const ClassDesc **) [protected], [virtual]

this restores ClassDesc's. it will set the pointer to the address of the static ClassDesc for the class which has the same name as the class that had the ClassDesc that was saved by put(const ClassDesc*). no cap, that's a whole mouthful. 😭

Reimplemented in sc::MsgStateRecv, and sc::StateInText.

Referenced by get().

πŸ’… virtual int sc::StateIn::get_array_char (char * p, int size) [virtual]

these restore data saved with StateOut's put members β€” and the data must be preallocated by the user. so don't come crying to StateIn if you forgot, bestie. πŸ’€

Reimplemented in sc::StateInText.

πŸ’… virtual void sc::StateIn::get_header () [virtual]

reads in the header information, and changes the translation scheme if necessary. slay, adaptive behavior. 🌈

πŸ’… virtual int sc::StateIn::getobject (Ref< SavableState > &) [protected], [virtual]

this is used to restore an object. it's 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. yes, reference-to-the-reference is real and it's invited. πŸŽ€

Reimplemented in sc::StateInText.

πŸ’… virtual void sc::StateIn::list_objects (std::ostream & = ExEnv::out0()) [virtual]

lists all the objects to the stream. only StateIn specializations with directories can list objects β€” so don't expect directory energy from the ones that don't have one. πŸ’…

πŸ’… int sc::StateIn::node_to_node () const [inline]

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. very "i have my reasons" of them. ✨

πŸ’… virtual void sc::StateIn::seek (int) [virtual]

sets the current position in the file. the default implementation does nothing. literally does not move. it's giving "i'm just here for the vibes." πŸ’€

Reimplemented in sc::BcastStateInBin, and sc::StateInBin.

πŸ’… virtual int sc::StateIn::seekable () [virtual]

returns non-zero if seek does anything sensible. the default implementation returns 0. so yeah, default seek is not exactly main character energy. 😭

Reimplemented in sc::BcastStateInBin, and sc::StateInBin.


🌸 Author 🌸

generated automatically by Doxygen for MPQC from the source code. so no human wrote this bit, and honestly? it shows. πŸ’€πŸ«Ά


version 2.3.1, dated Sun Oct 4 2020 β€” that's the footer, bestie, and we are done. go restore some SavableState objects and slay. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from