---
name: "sc_BcastStateInBin"
section: "3"
platform: "linux"
package: "libsc-doc"
version: "2.3.1-22"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/sc_BcastStateInBin"
---

# sc\_BcastStateInBin(3)

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.

## NAME

sc::BcastStateInBin - 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.

## SYNOPSIS

`#include <mstate.h>`

Inherits **sc::MsgStateBufRecv**.

### 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.  int **seekable** ()\
 Return non-zero if seek does anything sensible.  int **tell** ()\
 Return the current position in the file.  int **use\_directory** ()\
 Returns true of this object uses a directory.

### Protected Member Functions

void **next\_buffer** ()\
 Specializations must implement **next\_buffer()**.  int **get\_array\_void** (void \*, int)\

### Protected Attributes

int **opened\_**\
 int **file\_position\_**\
 std::streambuf \* **buf\_**\

## 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

### int sc::BcastStateInBin::get\_array\_void (void \*, int)` [protected]`, ` [virtual]`

Reimplemented from **sc::MsgStateBufRecv**.

### void sc::BcastStateInBin::next\_buffer ()` [protected]`, ` [virtual]`

Specializations must implement **next\_buffer()**.

Implements **sc::MsgStateBufRecv**.

### void sc::BcastStateInBin::seek (int)` [virtual]`

Set the current position in the file. The default implementation does nothing.

Reimplemented from **sc::StateIn**.

### int sc::BcastStateInBin::seekable ()` [virtual]`

Return non-zero if seek does anything sensible. The default implementation returns 0.

Reimplemented from **sc::StateIn**.

### int sc::BcastStateInBin::tell ()` [virtual]`

Return the current position in the file.

Reimplemented from **sc::StateIn**.

### int sc::BcastStateInBin::use\_directory ()` [virtual]`

Returns true of this object uses a directory.

Reimplemented from **sc::StateIn**.

## Author

Generated automatically by Doxygen for MPQC from the source code.
