BMemoryStore Class Reference
[Data Model]

#include <support/MemoryStore.h>

Inheritance diagram for BMemoryStore:

BnStorage BByteStream BnInterface< IStorage > BnByteInput BnByteOutput BnByteSeekable IStorage BBinder BnInterface< IByteInput > BnInterface< IByteOutput > BnInterface< IByteSeekable > BBinder IByteSeekable BBinder IByteOutput BBinder IByteInput IBinder IInterface BDatabaseStore BMallocStore BValueStorage BStringIO List of all members.

Detailed Description

Generic implementation of storage and byte streams on a block of memory.

This class can be used as-is on an existing pieces of memory (which is very dangerous due to reference counting), or subclasses can provide their own memory management semantics (such as BMallocStore).

Todo:
Change this to be based off of BStreamDatum.


Public Member Functions

status_t AssertSpace (size_t newSize)
 BMemoryStore (const void *data, size_t size)
 BMemoryStore (void *data, size_t size)
 BMemoryStore (const BMemoryStore &)
 BMemoryStore ()
const void * Buffer () const
 Direct access to the buffer.
size_t BufferSize () const
 Direct access to buffer size.
int32_t Compare (const BMemoryStore &) const
status_t Copy (const BMemoryStore &)
virtual SValue Inspect (const sptr< IBinder > &caller, const SValue &which, uint32_t flags=0)
 Probe binder for interface information.
bool operator!= (const BMemoryStore &) const
bool operator< (const BMemoryStore &) const
bool operator<= (const BMemoryStore &) const
BMemoryStoreoperator= (const BMemoryStore &)
bool operator== (const BMemoryStore &) const
bool operator> (const BMemoryStore &) const
bool operator>= (const BMemoryStore &) const
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.
void SetBlockSize (size_t blocksize)
virtual status_t SetSize (off_t position)
 Set the total number of bytes in the store.
virtual off_t Size () const
 Return the total number of bytes in the store.
virtual status_t Sync ()
 Make sure all data in the stream is written to its physical device.
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.

Protected Member Functions

void Reset ()
virtual ~BMemoryStore ()


Constructor & Destructor Documentation

BMemoryStore  ) 
 

BMemoryStore const BMemoryStore  ) 
 

BMemoryStore void *  data,
size_t  size
 

BMemoryStore const void *  data,
size_t  size
 

~BMemoryStore  )  [protected, virtual]
 


Member Function Documentation

status_t AssertSpace size_t  newSize  ) 
 

const void * Buffer  )  const
 

Direct access to the buffer.

size_t BufferSize  )  const
 

Direct access to buffer size.

The same as Size(), but it can be convenient when you know you are dealing with a BMemoryStore (and thus don't need a full off_t to contain the size).

int32_t Compare const BMemoryStore  )  const
 

status_t Copy const BMemoryStore  ) 
 

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

Probe binder for interface information.

Return interfaces implemented by this binder object that are requested by which. This is a composition of all interfaces, expressed as { descriptor -> binder } mappings, which are selected through which.

Much more information on Inspect() can be found at Binder Inspect() Details.

Reimplemented from BByteStream.

bool operator!= const BMemoryStore  )  const [inline]
 

bool operator< const BMemoryStore  )  const [inline]
 

bool operator<= const BMemoryStore  )  const [inline]
 

BMemoryStore & operator= const BMemoryStore  ) 
 

bool operator== const BMemoryStore  )  const [inline]
 

bool operator> const BMemoryStore  )  const [inline]
 

bool operator>= const BMemoryStore  )  const [inline]
 

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.

Reimplemented in BValueStorage.

void Reset  )  [protected]
 

Reimplemented in BStringIO.

void SetBlockSize size_t  blocksize  ) 
 

Reimplemented in BMallocStore.

status_t SetSize off_t  position  )  [virtual]
 

Set the total number of bytes in the store.

Implements IStorage.

Reimplemented in BValueStorage.

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.

Reimplemented from BByteStream.

Reimplemented in BValueStorage.

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.

Reimplemented in BValueStorage.


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