32#ifndef _util_group_mstate_h
33#define _util_group_mstate_h
35#include <util/state/state.h>
36#include <util/state/statein.h>
37#include <util/state/stateout.h>
38#include <util/group/message.h>
59 int put_array_void(
const void*,
int);
75 int put(
unsigned int r);
79 int put(
const char*,
int);
80 int put(
const int*,
int);
81 int put(
const unsigned int*,
int);
82 int put(
const float*,
int);
83 int put(
const double*,
int);
104 int get_array_void(
void*,
int);
142 int get(
char&r,
const char *key = 0);
143 int get(
unsigned int&r,
const char *key = 0);
144 int get(
int&r,
const char *key = 0);
145 int get(
float&r,
const char *key = 0);
146 int get(
double&r,
const char *key = 0);
148 int get(
unsigned int*&);
246 void bcast(
double &);
247 void bcast(
int *&,
int);
248 void bcast(
double *&,
int);
282 std::streambuf *buf_;
285 int get_array_void(
void*,
int);
294 virtual int open(
const char *name);
295 virtual void close();
BcastStateBin reads a file in written by StateInBin on node 0 and broadcasts it to all nodes so state...
Definition mstate.h:274
void seek(int loc)
Set the current position in the file.
int use_directory()
Returns true of this object uses a directory.
BcastStateInBin(const Ref< KeyVal > &)
Create the BcastStateRecv using the default MessageGrp.
int seekable()
Return non-zero if seek does anything sensible.
void next_buffer()
Specializations must implement next_buffer().
int tell()
Return the current position in the file.
BcastStateInBin(const Ref< MessageGrp > &, const char *filename)
Create the BcastStateRecv.
BcastStateRecv does the receive part of a broadcast of an object to all nodes.
Definition mstate.h:214
BcastStateRecv(const Ref< MessageGrp > &, int source=0)
Create the BcastStateRecv.
void next_buffer()
Specializations must implement next_buffer().
void source(int s)
Set the source node.
BcastStateSend does the send part of a broadcast of an object to all nodes.
Definition mstate.h:197
void flush()
Flush the data remaining in the buffer.
BcastStateSend(const Ref< MessageGrp > &)
Create the BcastStateSend.
This creates and forwards/retrieves data from either a BcastStateRecv or a BcastStateSend depending o...
Definition mstate.h:232
void flush()
Force data to be written.
void forget_references()
Call the StateOut or StateIn forget_references member.
void bcast(int &)
Broadcast data to all nodes.
void set_buffer_size(int)
Controls the amount of data that is buffered before it is sent.
BcastState(const Ref< MessageGrp > &, int source=0)
Create a BcastState object. The default source is node 0.
This class is used to contain information about classes.
Definition class.h:158
The MsgStateBufRecv is an abstract base class that buffers objects sent through a MessageGrp.
Definition mstate.h:89
virtual void next_buffer()=0
Specializations must implement next_buffer().
MsgStateBufRecv(const Ref< MessageGrp > &)
MsgStateBufRecv can be initialized with a MessageGrp.
void set_buffer_size(int)
The buffer size of statein and stateout objects that communicate with each other must match.
MsgStateBufRecv()
Use the default MessageGrp.
The MsgStateRecv is an abstract base class that receives objects from nodes in a MessageGrp.
Definition mstate.h:123
int get(char *&)
These restore data saved with StateOut's put.
MsgStateRecv(const Ref< MessageGrp > &)
MsgStateRecv must be initialized with a MessageGrp.
int version(const ClassDesc *)
Returns the version of the ClassDesc.
int get(char &r, const char *key=0)
These restore data saved with StateOut's put. members.
int get(const ClassDesc **)
I only need to override get(ClassDesc**) but C++ will hide all of the other get's so I must override ...
The MsgStateSend is an abstract base class that sends objects to nodes in a MessageGrp.
Definition mstate.h:45
int put(const char *, int)
Write the given array data.
int put(char r)
Write the given datum.
void set_buffer_size(int)
The buffer size of statein and stateout objects that communicate with each other must match.
virtual void flush()=0
Specializations must implement flush().
int put(const ClassDesc *)
I only need to override put(const ClassDesc*) but C++ will hide all of the other put's so I must over...
A template class that maintains references counts.
Definition ref.h:332
T * pointer() const
Returns a pointer the reference counted object.
Definition ref.h:383
static SavableState * restore_state(StateIn &si)
Restores objects saved with save_state.
void save_state(StateOut &)
Save the state of the object as specified by the StateOut object.
Restores objects that derive from SavableState.
Definition statein.h:70
Serializes objects that derive from SavableState.
Definition stateout.h:61
StateRecv is a concrete specialization of MsgStateRecv that does the receive part of point to point c...
Definition mstate.h:178
void source(int)
Specify the source node.
StateRecv(const Ref< MessageGrp > &)
Create a StateRecv given a MessageGrp.
void next_buffer()
Specializations must implement next_buffer().
StateSend is a concrete specialization of MsgStateSend that does the send part of point to point comm...
Definition mstate.h:157
void flush()
Flush the buffer.
StateSend(const Ref< MessageGrp > &)
Create a StateSend given a MessageGrp.
void target(int)
Specify the target node.