BValueDatum Class Reference
[Data Model]

#include <storage/ValueDatum.h>

Inheritance diagram for BValueDatum:

BStreamDatum BGenericDatum BnDatum IDatum BBinder IInterface IBinder SAtom SAtom List of all members.

Detailed Description

A concrete implementation of BStreamData holding a generic SValue.

This class is a complete implementation of IDatum on top of an SValue. It uses the memory model of BStreamData to perform read and write operations on the SValue it contains.

Todo:
Need to consider what to do with B_STRING_TYPE in terms of NUL-termination.
Todo:
Should probably introduce a BAbstractValueDatum class that this one derives from, and/or add facilities to allow clients to more easily control how the value can be modifed (restrict its possible types etc).


Bookkeeping

Creation, destruction, locking, etc.

 BValueDatum (const SContext &context, const SValue &value, uint32_t mode=IDatum::READ_WRITE)
 BValueDatum (const SValue &value, uint32_t mode=IDatum::READ_WRITE)
 BValueDatum (const SContext &context, uint32_t mode=IDatum::READ_WRITE)
 BValueDatum (uint32_t mode=IDatum::READ_WRITE)
virtual ~BValueDatum ()

BStreamDatum Implementation

Provide BStreamDatum implementation to create a concrete class. This implements both the stream and memory models, for best performance.

virtual void FinishReadingLocked (const sptr< Stream > &stream, const void *data) const
 Clean up from reading (currently a noop).
virtual void FinishWritingLocked (const sptr< Stream > &stream, void *data)
 Finish editing the value.
virtual off_t SizeLocked () const
 Returns the current number of bytes in the value.
virtual const void * StartReadingLocked (const sptr< Stream > &stream, off_t position, ssize_t *inoutSize, uint32_t flags) const
 Return bytes in the value for reading.
virtual void * StartWritingLocked (const sptr< Stream > &stream, off_t position, ssize_t *inoutSize, uint32_t flags)
 Edit bytes inside the value, returning the requested starting address.
virtual status_t StoreSizeLocked (off_t size)
 Changes the size of the value.
virtual status_t StoreValueLocked (const SValue &value)
 Changes the entire value.
virtual status_t StoreValueTypeLocked (uint32_t type)
 Changes the type code of the value.
virtual SValue ValueLocked () const
 Returns the current value.
virtual uint32_t ValueTypeLocked () const
 Returns the current type code of the value.


Constructor & Destructor Documentation

BValueDatum uint32_t  mode = IDatum::READ_WRITE  ) 
 

BValueDatum const SContext context,
uint32_t  mode = IDatum::READ_WRITE
 

BValueDatum const SValue value,
uint32_t  mode = IDatum::READ_WRITE
 

BValueDatum const SContext context,
const SValue value,
uint32_t  mode = IDatum::READ_WRITE
 

~BValueDatum  )  [protected, virtual]
 


Member Function Documentation

void FinishReadingLocked const sptr< Stream > &  stream,
const void *  data
const [virtual]
 

Clean up from reading (currently a noop).

Reimplemented from BStreamDatum.

void FinishWritingLocked const sptr< Stream > &  stream,
void *  data
[virtual]
 

Finish editing the value.

Reimplemented from BStreamDatum.

off_t SizeLocked  )  const [virtual]
 

Returns the current number of bytes in the value.

Implements BStreamDatum.

const void * StartReadingLocked const sptr< Stream > &  stream,
off_t  position,
ssize_t *  inoutSize,
uint32_t  flags
const [virtual]
 

Return bytes in the value for reading.

Reimplemented from BStreamDatum.

void * StartWritingLocked const sptr< Stream > &  stream,
off_t  position,
ssize_t *  inoutSize,
uint32_t  flags
[virtual]
 

Edit bytes inside the value, returning the requested starting address.

Reimplemented from BStreamDatum.

status_t StoreSizeLocked off_t  size  )  [virtual]
 

Changes the size of the value.

Implements BStreamDatum.

status_t StoreValueLocked const SValue value  )  [virtual]
 

Changes the entire value.

Reimplemented from BStreamDatum.

status_t StoreValueTypeLocked uint32_t  type  )  [virtual]
 

Changes the type code of the value.

Note:
The implementation currently doesn't do anything special with B_STRING_TYPE, meaning it allows clients to create invalid string values (ones that don't include a final NUL).

Reimplemented from BStreamDatum.

SValue ValueLocked  )  const [virtual]
 

Returns the current value.

Reimplemented from BStreamDatum.

uint32_t ValueTypeLocked  )  const [virtual]
 

Returns the current type code of the value.

Reimplemented from BStreamDatum.


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