qpid::framing::Blob< Size, BaseType > Class Template Reference

A Blob is a chunk of memory which can contain a single object at a time-arbitrary type, provided sizeof(T)<=blob.size(). More...

#include <Blob.h>

Inheritance diagram for qpid::framing::Blob< Size, BaseType >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 Blob ()
 Construct an empty Blob.
 Blob (const Blob &b)
 Copy a Blob.
template<class InPlace>
 Blob (const InPlace &expr, typename EnableInPlace< InPlace >::type *=0)
 Construct from in_place constructor.
template<class T>
 Blob (const T &t, typename DisableInPlace< T >::type *=0)
 Construct by copying an object constructor.
Bloboperator= (const Blob &b)
 Assign from another Blob.
template<class InPlace>
EnableInPlace< InPlace, Blob & >
::type 
operator= (const InPlace &expr)
 Assign from an in_place constructor expression.
template<class T>
DisableInPlace< T, Blob & >::type operator= (const T &x)
 Assign from an object of type T.
BaseType * get ()
 Get pointer to Blob contents, returns 0 if empty.
const BaseType * get () const
 Get pointer to Blob contents, returns 0 if empty.
void clear ()
 Destroy the object in the Blob making it empty.
bool empty () const

Static Public Member Functions

static size_t size ()


Detailed Description

template<size_t Size, class BaseType = void>
class qpid::framing::Blob< Size, BaseType >

A Blob is a chunk of memory which can contain a single object at a time-arbitrary type, provided sizeof(T)<=blob.size().

Using Blobs ensures proper construction and destruction of its contents, and proper copying between Blobs, but nothing else.

In particular you must ensure that the Blob is big enough for its contents and must know the type of object in the Blob to cast get().

If BaseType is specified then only an object that can be static_cast to BaseType may be stored in the Blob.


Constructor & Destructor Documentation

template<size_t Size, class BaseType = void>
qpid::framing::Blob< Size, BaseType >::Blob (  )  [inline]

Construct an empty Blob.

template<size_t Size, class BaseType = void>
qpid::framing::Blob< Size, BaseType >::Blob ( const Blob< Size, BaseType > &  b  )  [inline]

Copy a Blob.

template<size_t Size, class BaseType = void>
template<class InPlace>
qpid::framing::Blob< Size, BaseType >::Blob ( const InPlace &  expr,
typename EnableInPlace< InPlace >::type *  = 0 
) [inline]

Construct from in_place constructor.

template<size_t Size, class BaseType = void>
template<class T>
qpid::framing::Blob< Size, BaseType >::Blob ( const T &  t,
typename DisableInPlace< T >::type *  = 0 
) [inline]

Construct by copying an object constructor.


Member Function Documentation

template<size_t Size, class BaseType = void>
Blob& qpid::framing::Blob< Size, BaseType >::operator= ( const Blob< Size, BaseType > &  b  )  [inline]

Assign from another Blob.

template<size_t Size, class BaseType = void>
template<class InPlace>
EnableInPlace<InPlace,Blob&>::type qpid::framing::Blob< Size, BaseType >::operator= ( const InPlace &  expr  )  [inline]

Assign from an in_place constructor expression.

template<size_t Size, class BaseType = void>
template<class T>
DisableInPlace<T, Blob&>::type qpid::framing::Blob< Size, BaseType >::operator= ( const T &  x  )  [inline]

Assign from an object of type T.

template<size_t Size, class BaseType = void>
BaseType* qpid::framing::Blob< Size, BaseType >::get (  )  [inline]

Get pointer to Blob contents, returns 0 if empty.

template<size_t Size, class BaseType = void>
const BaseType* qpid::framing::Blob< Size, BaseType >::get (  )  const [inline]

Get pointer to Blob contents, returns 0 if empty.

template<size_t Size, class BaseType = void>
void qpid::framing::Blob< Size, BaseType >::clear (  )  [inline]

Destroy the object in the Blob making it empty.

Referenced by qpid::framing::Blob< Size, BaseHeld >::operator=().


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

Generated on Thu May 15 22:24:26 2008 for Qpid by  doxygen 1.5.5