WWC snapshot of http://www.alw.nih.gov/Docs/NIHCL/nihcl_31.html taken on Sat Jun 10 19:13:51 1995

Go to the previous, next section.

OIOnihin--Stream Object Input Formatting

SYNOPSIS

#include <nihcl/OIOnih.h>

BASE CLASS

OIOistream

DERIVED CLASSES

None

RELATED CLASSES

OIOnihout

DESCRIPTION

Class OIOnihin implements a simple "NIH format" object input from istreams for the readFrom() function. It inherits virtual member functions for reading the fundamental data types, arrays of fundamental data types, and C-style (null-terminated) character strings. It also inherits virtual member functions for setting and accessing the input format precision and field width. It defines a readObject() member function to interpret the object format written by OIOnihout::storeObject().

CONSTRUCTORS

OIOnihin(istream& s, unsigned capacity =1024)
Constructs an OIOnihin for the istream s with an initial object capacity of capacity objects (see class ReadFromTbl).

PROTECTED MEMBERS

Object I/O

virtual Object* readObject(const Class& expect)
Reads an object stored by OIOnihout::storeObject() from the istream associated with this OIOnihin.

Raises an NIHCL_RDUNKCLASS exception if the class descriptor of the object to be read has not been linked with the program.

Raises an NIHCL_RDWRONGCLASS exception if the class of the object read is not an instance of class expected or an instance of a derived class of expected.

Raises an NIHCL_RDBADSIG exception if the signature of the class of the object read does not match the signature of the class descriptor of the same name that has been linked with the program. This is to detect an attempt to read an object stored by an outdated version of the class.

Returns a pointer to the object read if successful.

EXCEPTIONS RAISED

NIHCL_RDEOF, NIHCL_RDFAIL, NIHCL_RDSYNERR, NIHCL_RDWRONGCLASS, NIHCL_RDUNKCLASS,
NIHCL_RDBADSIG

Go to the previous, next section.