Polaris: BinPtr Class Reference

BinPtr Class Reference

file BinPtr.h a class for doing item I/O on a memory buffer. More...

#include <BinPtr.h>

List of all members.

Public Member Functions

 BinPtr (const void *base)
 Initialize the BinPtr the the memory buffer at base.
 BinPtr (istream &fs)
 Initialize the BinPtr to the input stream fs.
 BinPtr (ostream &fs)
 Initialize the BinPtr to the output stream fs.
 ~BinPtr ()
 Destroy the BinPtr.
void fetch (void *buf, int length)
 Read in length bytes from the input.
void fetch (binptr_4 &x)
 Read a 4 byte integer.
void fetch (binptr_2 &x)
 Read a 2 byte integer.
void fetch (binptr_1 &x)
 Read a 1 byte integer.
void fetch (double &x)
 Read an 8 byte floating point number.
void store (const void *buf, int length)
 Write out length bytes to the output.
void store (long value, int length)
 Write value as a length byte integer.
void store (binptr_4 &x)
 Write a 4 byte integer.
void store (binptr_2 &x)
 Write a 2 byte integer.
void store (binptr_1 &x)
 Write a 1 byte integer.
void store (double &x)
 Write an 8 byte floating point number.
void reset (const void *base)
 Initialize the BinPtr to base.
void reset (istream &fs)
 Initialize the BinPtr to input from fs.
void reset (ostream &fs)
 Initialize the BinPtr to write to fs.


Detailed Description

file BinPtr.h a class for doing item I/O on a memory buffer.

Polaris Base

See also:
BinPtr.h

BinPtr.h

Overview

This classes is intended for reading/writing binary objects to a section of memory. It is essentially a frontend to the <memory.h> commands. In addition, we can also read from a file with the same interface.

Description

The BinRep class needs to have easy access to the binary representation of items stored in a stream of memory. Also, we need to be able to do the same operations is the memory buffer is mapped to a iostream.

Definition at line 39 of file BinPtr.h.


Constructor & Destructor Documentation

BinPtr::BinPtr const void *  base  )  [inline]
 

Initialize the BinPtr the the memory buffer at base.

Definition at line 102 of file BinPtr.h.

References register_instance(), and reset().

BinPtr::BinPtr istream &  fs  )  [inline]
 

Initialize the BinPtr to the input stream fs.

Definition at line 112 of file BinPtr.h.

References register_instance(), and reset().

BinPtr::BinPtr ostream &  fs  )  [inline]
 

Initialize the BinPtr to the output stream fs.

Definition at line 122 of file BinPtr.h.

References register_instance(), and reset().

BinPtr::~BinPtr  )  [inline]
 

Destroy the BinPtr.

Definition at line 132 of file BinPtr.h.

References unregister_instance().


Member Function Documentation

void BinPtr::fetch void *  buf,
int  length
[inline]
 

Read in length bytes from the input.

Definition at line 142 of file BinPtr.h.

Referenced by BinRep::_ief_parse(), and aux_setl_parse().

void BinPtr::fetch binptr_4 x  )  [inline]
 

Read a 4 byte integer.

Definition at line 153 of file BinPtr.h.

void BinPtr::fetch binptr_2 x  )  [inline]
 

Read a 2 byte integer.

Definition at line 164 of file BinPtr.h.

void BinPtr::fetch binptr_1 x  )  [inline]
 

Read a 1 byte integer.

Definition at line 175 of file BinPtr.h.

void BinPtr::fetch double &  x  )  [inline]
 

Read an 8 byte floating point number.

Definition at line 186 of file BinPtr.h.

void BinPtr::store const void *  buf,
int  length
[inline]
 

Write out length bytes to the output.

Definition at line 199 of file BinPtr.h.

Referenced by BinRep::put_string().

void BinPtr::store long  value,
int  length
[inline]
 

Write value as a length byte integer.

Definition at line 210 of file BinPtr.h.

void BinPtr::store binptr_4 x  )  [inline]
 

Write a 4 byte integer.

Definition at line 255 of file BinPtr.h.

void BinPtr::store binptr_2 x  )  [inline]
 

Write a 2 byte integer.

Definition at line 266 of file BinPtr.h.

void BinPtr::store binptr_1 x  )  [inline]
 

Write a 1 byte integer.

Definition at line 277 of file BinPtr.h.

void BinPtr::store double &  x  )  [inline]
 

Write an 8 byte floating point number.

Definition at line 288 of file BinPtr.h.

void BinPtr::reset const void *  base  )  [inline]
 

Initialize the BinPtr to base.

Definition at line 301 of file BinPtr.h.

Referenced by BinRep::_ief_parse(), and BinPtr().

void BinPtr::reset istream &  fs  )  [inline]
 

Initialize the BinPtr to input from fs.

Definition at line 308 of file BinPtr.h.

void BinPtr::reset ostream &  fs  )  [inline]
 

Initialize the BinPtr to write to fs.

Definition at line 315 of file BinPtr.h.


The documentation for this class was generated from the following file:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:07:02 2005