MPQC  2.3.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
sc::BcastStateInBin Class Reference

BcastStateBin reads a file in written by StateInBin on node 0 and broadcasts it to all nodes so state can be simultaneously restored on all nodes. More...

#include <mstate.h>

Inheritance diagram for sc::BcastStateInBin:
Inheritance graph
[legend]
Collaboration diagram for sc::BcastStateInBin:
Collaboration graph
[legend]

Public Member Functions

 BcastStateInBin (const Ref< KeyVal > &)
 Create the BcastStateRecv using the default MessageGrp.
 
 BcastStateInBin (const Ref< MessageGrp > &, const char *filename)
 Create the BcastStateRecv.
 
virtual int open (const char *name)
 
virtual void close ()
 
void seek (int loc)
 Set the current position in the file. More...
 
int seekable ()
 Return non-zero if seek does anything sensible. More...
 
int tell ()
 Return the current position in the file.
 
int use_directory ()
 Returns true of this object uses a directory.
 
- Public Member Functions inherited from sc::MsgStateBufRecv
 MsgStateBufRecv (const Ref< MessageGrp > &)
 MsgStateBufRecv can be initialized with a MessageGrp.
 
 MsgStateBufRecv ()
 Use the default MessageGrp.
 
void set_buffer_size (int)
 The buffer size of statein and stateout objects that communicate with each other must match.
 
- Public Member Functions inherited from sc::StateIn
virtual void get_header ()
 Read in the header information. More...
 
virtual int version (const ClassDesc *)
 Returns the version of the ClassDesc in the persistent object or -1 if info on the ClassDesc doesn't exist.
 
virtual int getstring (char *&)
 This restores strings saved with StateOut::putstring.
 
virtual int get (std::string &)
 This restores a std::string object.
 
virtual int get (char &r, const char *keyword=0)
 These restore data saved with StateOut's put. members.
 
virtual int get (unsigned int &r, const char *keyword=0)
 
virtual int get (int &r, const char *keyword=0)
 
virtual int get (bool &r, const char *keyword=0)
 
virtual int get (float &r, const char *keyword=0)
 
virtual int get (double &r, const char *keyword=0)
 
virtual int get (char *&)
 These restore data saved with StateOut's put. More...
 
virtual int get (unsigned int *&)
 
virtual int get (int *&)
 
virtual int get (float *&)
 
virtual int get (double *&)
 
virtual int get_array_char (char *p, int size)
 These restore data saved with StateOut's put. More...
 
virtual int get_array_uint (unsigned int *p, int size)
 
virtual int get_array_int (int *p, int size)
 
virtual int get_array_float (float *p, int size)
 
virtual int get_array_double (double *p, int size)
 
template<class T >
int get (typename std::vector< T > &v)
 Read an STL vector of data.
 
int node_to_node () const
 True if this is a node to node save/restore. More...
 
int has_directory () const
 
virtual void list_objects (std::ostream &=ExEnv::out0())
 List all the objects to the stream. More...
 
void set_override (const Ref< KeyVal > &kv)
 Give this StateIn a KeyVal object that is used to override values.
 
const Ref< KeyVal > & override () const
 Return the KeyVal used to override values.
 
- Public Member Functions inherited from sc::DescribedClass
 DescribedClass (const DescribedClass &)
 
DescribedClassoperator= (const DescribedClass &)
 
ClassDescclass_desc () const throw ()
 This returns the unique pointer to the ClassDesc corresponding to the given type_info object. More...
 
const char * class_name () const
 Return the name of the object's exact type.
 
int class_version () const
 Return the version of the class.
 
virtual void print (std::ostream &=ExEnv::out0()) const
 Print the object.
 
- Public Member Functions inherited from sc::RefCount
int lock_ptr () const
 Lock this object.
 
int unlock_ptr () const
 Unlock this object.
 
void use_locks (bool inVal)
 start and stop using locks on this object
 
refcount_t nreference () const
 Return the reference count.
 
refcount_t reference ()
 Increment the reference count and return the new count.
 
refcount_t dereference ()
 Decrement the reference count and return the new count.
 
int managed () const
 
void unmanage ()
 Turn off the reference counting mechanism for this object. More...
 
int managed () const
 Return 1 if the object is managed. Otherwise return 0.
 
- Public Member Functions inherited from sc::Identity
Identifier identifier ()
 Return the Identifier for this argument. More...
 

Protected Member Functions

void next_buffer ()
 Specializations must implement next_buffer().
 
int get_array_void (void *, int)
 
- Protected Member Functions inherited from sc::StateIn
int push_key (const char *key)
 
void pop_key (int n)
 
const char * key ()
 
void get_directory ()
 
int directory_location () const
 
void find_and_get_directory ()
 
virtual int getobject (Ref< SavableState > &)
 This is used to restore an object. More...
 
virtual int dir_getobject (Ref< SavableState > &, const char *name)
 This 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**);.
 
virtual void haveobject (const Ref< SavableState > &)
 
void have_classdesc ()
 
int need_classdesc ()
 
virtual int get (const ClassDesc **)
 This restores ClassDesc's. More...
 
- Protected Member Functions inherited from sc::RefCount
 RefCount (const RefCount &)
 
RefCountoperator= (const RefCount &)
 

Protected Attributes

int opened_
 
int file_position_
 
std::streambuf * buf_
 
- Protected Attributes inherited from sc::MsgStateBufRecv
Ref< MessageGrpgrp
 
int nbuf
 
int ibuf
 
int bufsize
 
char * buffer
 
char * send_buffer
 
int nheader
 
int * nbuf_buffer
 
- Protected Attributes inherited from sc::StateIn
Ref< KeyValoverride_
 
TranslateDataIntranslate_
 
std::map< int, StateInDataps_
 
int expected_object_num_
 
std::map< ClassDescP, int > classidmap_
 
std::map< int, StateClassDataclassdatamap_
 
int nextclassid_
 
int node_to_node_
 
int version_
 
int date_
 
char userid_ [9]
 
char format_
 

Detailed Description

BcastStateBin reads a file in written by StateInBin on node 0 and broadcasts it to all nodes so state can be simultaneously restored on all nodes.

Member Function Documentation

◆ seek()

void sc::BcastStateInBin::seek ( int  )
virtual

Set the current position in the file.

The default implementation does nothing.

Reimplemented from sc::StateIn.

◆ seekable()

int sc::BcastStateInBin::seekable ( )
virtual

Return non-zero if seek does anything sensible.

The default implementation returns 0.

Reimplemented from sc::StateIn.


The documentation for this class was generated from the following file:

Generated at Sun Jan 26 2020 23:33:05 for MPQC 2.3.1 using the documentation package Doxygen 1.8.16.