BStreamDatum::Stream Class Reference
[Data Model]

#include <storage/StreamDatum.h>

Inheritance diagram for BStreamDatum::Stream:

BnByteInput BnByteOutput BnByteSeekable BnStorage BnInterface< IByteInput > BnInterface< IByteOutput > BnInterface< IByteSeekable > BnInterface< IStorage > BBinder IStorage BBinder IByteSeekable BBinder IByteOutput BBinder IByteInput List of all members.

Detailed Description

An open stream on BStreamDatum.


Access Stream Information

sptr< BStreamDatumDatum () const
 Datum the stream is from. Doesn't acquire the lock.
sptr< IBinderDefaultInterface () const
 Default stream IBinder (IByteInput or IByteOutput) to return. Doesn't acquire the lock.
sptr< IBinderEditor () const
 Editor object associated with the stream. Doesn't acquire the lock.
uint32_t Mode () const
 Open mode of the stream. Doesn't acquire the lock.
uint32_t Type () const
 Open type code of the stream. Doesn't acquire the lock.

Bookkeeping

Creation, destruction, etc.

virtual SValue Inspect (const sptr< IBinder > &caller, const SValue &which, uint32_t flags=0)
 Return the available stream interfaces based on the open mode.
 Stream (const SContext &context, const sptr< BStreamDatum > &datum, uint32_t mode, uint32_t type, const sptr< IBinder > &editor)
 Return the available stream interfaces based on the open mode.
virtual status_t FinishAtom (const void *id)
 The destructor must call Lock(), so return FINISH_ATOM_ASYNC to avoid deadlocks.
virtual void InitAtom ()
 Attach to the BStreamDatum and set type code / erase as requested.
virtual ~Stream ()
 Return the available stream interfaces based on the open mode.

IByteInput/IByteOutput/IByteSeekable

virtual off_t Position () const
 Return the current location in the stream, or a negative error code.
virtual ssize_t ReadV (const struct iovec *vector, ssize_t count, uint32_t flags=0)
virtual off_t Seek (off_t position, uint32_t seek_mode)
 Move to a new location in the stream.
virtual status_t Sync ()
 Make sure all data in the stream is written to its physical device.
virtual ssize_t WriteV (const struct iovec *vector, ssize_t count, uint32_t flags=0)

IStorage

virtual ssize_t ReadAtV (off_t position, const struct iovec *vector, ssize_t count)
 Read the bytes described by iovec from location position in the storage.
virtual status_t SetSize (off_t size)
 Set the total number of bytes in the store.
virtual off_t Size () const
 Return the total number of bytes in the store.
virtual ssize_t WriteAtV (off_t position, const struct iovec *vector, ssize_t count)
 Write the bytes described by iovec at location position in the storage.


Constructor & Destructor Documentation

Stream const SContext context,
const sptr< BStreamDatum > &  datum,
uint32_t  mode,
uint32_t  type,
const sptr< IBinder > &  editor
 

Return the available stream interfaces based on the open mode.

~Stream  )  [protected, virtual]
 

Return the available stream interfaces based on the open mode.


Member Function Documentation

sptr< BStreamDatum > Datum  )  const
 

Datum the stream is from. Doesn't acquire the lock.

sptr< IBinder > DefaultInterface  )  const
 

Default stream IBinder (IByteInput or IByteOutput) to return. Doesn't acquire the lock.

sptr< IBinder > Editor  )  const
 

Editor object associated with the stream. Doesn't acquire the lock.

status_t FinishAtom const void *  id  )  [protected, virtual]
 

The destructor must call Lock(), so return FINISH_ATOM_ASYNC to avoid deadlocks.

Reimplemented from SAtom.

void InitAtom  )  [protected, virtual]
 

Attach to the BStreamDatum and set type code / erase as requested.

Reimplemented from SAtom.

SValue Inspect const sptr< IBinder > &  caller,
const SValue which,
uint32_t  flags = 0
[virtual]
 

Return the available stream interfaces based on the open mode.

Reimplemented from BnInterface< IStorage >.

uint32_t Mode  )  const
 

Open mode of the stream. Doesn't acquire the lock.

off_t Position  )  const [virtual]
 

Return the current location in the stream, or a negative error code.

Implements IByteSeekable.

ssize_t ReadAtV off_t  position,
const struct iovec *  vector,
ssize_t  count
[virtual]
 

Read the bytes described by iovec from location position in the storage.

Returns the number of bytes actually read, or a negative error code.

Implements IStorage.

ssize_t ReadV const struct iovec *  vector,
ssize_t  count,
uint32_t  flags = 0
[virtual]
 

off_t Seek off_t  position,
uint32_t  seek_mode
[virtual]
 

Move to a new location in the stream.

The seek_mode can be either SEEK_SET, SEEK_END, or SEEK_CUR. Returns the new location, or a negative error code.

Implements IByteSeekable.

status_t SetSize off_t  size  )  [virtual]
 

Set the total number of bytes in the store.

Implements IStorage.

off_t Size  )  const [virtual]
 

Return the total number of bytes in the store.

Implements IStorage.

status_t Sync  )  [virtual]
 

Make sure all data in the stream is written to its physical device.

Returns B_OK if the data is safely stored away, else an error code.

Implements IByteOutput.

uint32_t Type  )  const
 

Open type code of the stream. Doesn't acquire the lock.

ssize_t WriteAtV off_t  position,
const struct iovec *  vector,
ssize_t  count
[virtual]
 

Write the bytes described by iovec at location position in the storage.

Returns the number of bytes actually written, or a negative error code.

Implements IStorage.

ssize_t WriteV const struct iovec *  vector,
ssize_t  count,
uint32_t  flags = 0
[virtual]
 


The documentation for this class was generated from the following files: