Default Blob value implementation. More...

#include <tntdb/impl/blob.h>

Inheritance diagram for tntdb::BlobImpl:
tntdb::IBlob cxxtools::AtomicRefCounted

Public Member Functions

 BlobImpl ()
 ~BlobImpl ()
virtual void assign (const char *data, std::size_t len)
 Assign data of a given length.
virtual char * reserve (std::size_t len, bool shrink)
 Makes sure, the buffer has at least len bytes.
virtual IBlobcreate () const
 Create a value implementation.
virtual void destroy ()
 Destroy a value implementation.
- Public Member Functions inherited from tntdb::IBlob
virtual ~IBlob ()
std::size_t size () const
 Returns the size of the blob-data.
const char * data () const
 Returns a pointer to the blob-data or 0 if the blob is empty.
bool operator== (const IBlob &other) const
 Returns true if the two instances contain the same data.
- Public Member Functions inherited from cxxtools::AtomicRefCounted
 AtomicRefCounted ()
 AtomicRefCounted (unsigned refs_)
virtual ~AtomicRefCounted ()
virtual atomic_t addRef ()
virtual atomic_t release ()
atomic_t refs () const

Static Public Member Functions

static BlobImplemptyInstance ()

Protected Member Functions

 BlobImpl (int)
- Protected Member Functions inherited from tntdb::IBlob
 IBlob ()

Additional Inherited Members

- Protected Attributes inherited from tntdb::IBlob
char * _data
std::size_t _size

Detailed Description

Default Blob value implementation.

This implementation uses new/delete to create and destroy the shared objects and new/delete to allocate memory for the blob-data.

Constructor & Destructor Documentation

tntdb::BlobImpl::BlobImpl ( )
tntdb::BlobImpl::~BlobImpl ( )
tntdb::BlobImpl::BlobImpl ( int  )

Member Function Documentation

virtual void tntdb::BlobImpl::assign ( const char *  data,
std::size_t  len 

Assign data of a given length.

The len bytes of the data pointed to by data are copied to this blob.

Implements tntdb::IBlob.

virtual IBlob* tntdb::BlobImpl::create ( ) const

Create a value implementation.

Returns a pointer to a implementation class derived from IBlob. IBlob::destroy must be implemented accordingly to destroy this instance.

Implements tntdb::IBlob.

virtual void tntdb::BlobImpl::destroy ( )

Destroy a value implementation.

Destroys an instance previously created by the IBlob::create.

Implements tntdb::IBlob.

static BlobImpl* tntdb::BlobImpl::emptyInstance ( )
virtual char* tntdb::BlobImpl::reserve ( std::size_t  len,
bool  shrink 

Makes sure, the buffer has at least len bytes.

Implements tntdb::IBlob.

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