Google Custom Search

BDataIO Class Reference
[Support Kit(libbe.so)]

Abstract interface for objects that provide read and write access to data. More...

Inheritance diagram for BDataIO:

BPositionIO BBufferIO BMallocIO BMemoryIO List of all members.

Public Member Functions

 BDataIO ()
 This constructor does nothing.
virtual ssize_t Read (void *buffer, size_t size)=0
 Pure virtual to read data.
virtual ssize_t Write (const void *buffer, size_t size)=0
 Pure virtual to write data.
virtual ~BDataIO ()
 This destructor does nothing.

Detailed Description

Abstract interface for objects that provide read and write access to data.

The interface provided by this class applies to objects or data that are limited to reading and writing data. Classes derived from this class should reimplement both the Read() and Write() method from this class.

Candidates of types of data or objects that should be derived from this class are probably broadcasting media streams (which don't support reading at a certain point in the data) or network streams that output data continously. Objects and data that support more advanced operations like seeking or reading at writing at defined positions should derive their classes from BPositionIO, which inherits this class.


Member Function Documentation

ssize_t BDataIO::Read ( void *  buffer,
size_t  size 
) [pure virtual]

Pure virtual to read data.

Your implementation should copy data into buffer, with the maximum size of size.

Returns:
You should return the amount of bytes actually read, or an error code in case of failure.

Implemented in BPositionIO.

ssize_t BDataIO::Write ( const void *  buffer,
size_t  size 
) [pure virtual]

Pure virtual to write data.

Your implementation should copy data from buffer, with the maximum size of size.

Returns:
You should return the amount of bytes actually written, or an error code in case of failure.

Implemented in BPositionIO.


The Haiku Book pre-R1 - BDataIO Class Reference
Generated on 14 Feb 2008