ldas-tools-framecpp 3.0.4
 
Loading...
Searching...
No Matches
FrameCPP::Common::MemoryBufferT< BT > Class Template Referenceabstract

Buffer appropriate for caching frame data. More...

#include <MemoryBuffer.hh>

Inheritance diagram for FrameCPP::Common::MemoryBufferT< BT >:
Collaboration diagram for FrameCPP::Common::MemoryBufferT< BT >:

Classes

class  BufferSeeder
 Seed an input buffer for MemoryBufferT from buffers. More...
 
class  Seeder
 Seed an input buffer for MemoryBufferT. More...
 

Public Types

typedef BT buffer_type
 
typedef buffer_type::char_type char_type
 
typedef BT buffer_type
 
typedef buffer_type::char_type char_type
 
typedef INT_4U buffer_size_type
 
typedef INT_4U buffer_size_type
 

Public Member Functions

 MemoryBufferT (std::ios::openmode Mode, const BT &Source, bool ParentAutoDelete=true)
 Default constructor.
 
 MemoryBufferT (std::ios::openmode Mode, bool ParentAutoDelete=true)
 Default constructor.
 
 MemoryBufferT (Seeder &Seed, bool ParentAutoDelete=true)
 Default constructor.
 
virtual ~MemoryBufferT ()
 Destructor.
 
bool FilterInternally () const
 Returns true if filtering happens internally; false otherwise.
 
std::string str ()
 
void str (const std::string &S)
 
 MemoryBufferT (std::ios::openmode Mode, const BT &Source, bool ParentAutoDelete=true)
 Default constructor.
 
 MemoryBufferT (std::ios::openmode Mode, bool ParentAutoDelete=true)
 Default constructor.
 
 MemoryBufferT (Seeder &Seed, bool ParentAutoDelete=true)
 Default constructor.
 
virtual ~MemoryBufferT ()
 Destructor.
 
bool FilterInternally () const
 Returns true if filtering happens internally; false otherwise.
 
std::string str ()
 
void str (const std::string &S)
 
bool AutoDelete () const
 
void AutoDelete (bool Value)
 
bool AutoDelete () const
 
void AutoDelete (bool Value)
 
virtual void FilterAdd (FrameCPP::Common::StreamFilter *Filter)
 Adds a filter to the stream.
 
virtual void FilterAdd (FrameCPP::Common::StreamFilter *Filter)
 Adds a filter to the stream.
 
virtual void FilterRemove (FrameCPP::Common::StreamFilter *Filter)
 Removes a filter from the stream.
 
virtual void FilterRemove (FrameCPP::Common::StreamFilter *Filter)
 Removes a filter from the stream.
 
template<class DT>
void filter (const DT &Data)
 
virtual void filter (const char_type *Start, const char_type *End)=0
 
void FilterBuffer (const char *Begin, const char *End)
 
void FilterBuffer (const char *Begin, const char *End)
 
const std::string & BufferId () const
 Retrieve the string identification of the buffer.
 
const std::string & BufferId () const
 Retrieve the string identification of the buffer.
 

Static Public Attributes

static const buffer_size_type M_BUFFER_SIZE_DEFAULT = 256 * 1024
 The default size for buffered input and output.
 
static const buffer_size_type M_BUFFER_SIZE_SYSTEM
 

Protected Types

typedef std::list< FrameCPP::Common::StreamFilter * > filters_type
 Type specifying the container holding the active filters.
 
typedef std::list< FrameCPP::Common::StreamFilter * > filters_type
 Type specifying the container holding the active filters.
 

Protected Member Functions

virtual MemoryBufferTsetbuf (char_type *S, std::streamsize N)
 Routine to register if the caller has specified a buffer.
 
virtual void buffer ()
 Initialization of the buffer.
 
virtual MemoryBufferTsetbuf (char_type *S, std::streamsize N)
 Routine to register if the caller has specified a buffer.
 
virtual void buffer ()
 Initialization of the buffer.
 
void bufferId (const std::string &Id)
 
void bufferId (const std::string &Id)
 

Protected Attributes

filters_type m_filters
 Container holding all active filters.
 

Private Member Functions

virtual void filter (const char_type *Begin, const char_type *End)
 Perform filtering operations on the stream.
 
virtual void filter (const char_type *Begin, const char_type *End)
 Perform filtering operations on the stream.
 

Private Attributes

boost::scoped_array< char_typebuffer_cache
 
bool buffer_user_supplied
 State of user supplied buffer.
 
bool m_auto_delete
 
std::string m_stream_id
 

Friends

class IStream
 
class OStream
 

Detailed Description

template<typename BT = std::stringbuf>
class FrameCPP::Common::MemoryBufferT< BT >

Buffer appropriate for caching frame data.

If the buffer is for input, then the buffer needs to be initialized with the contents. The initialization needs to be done as via the call to the str( ) method before the buffer is associated with an IFrameStream object.

Template Parameters
BTInternal storage type to hold the buffer contents.
MemoryBuffer imb( std::ios:in);
imb.str( frame_file_data );
IFrameStream ifs_mem( false, &imb );
Definition FrameStream.hh:239
MemoryBufferT MemoryBuffer
Definition MemoryBuffer.hh:198

Member Typedef Documentation

◆ buffer_size_type [1/2]

◆ buffer_size_type [2/2]

◆ buffer_type [1/2]

template<typename BT = std::stringbuf>
typedef BT FrameCPP::Common::MemoryBufferT< BT >::buffer_type

◆ buffer_type [2/2]

template<typename BT = std::stringbuf>
typedef BT FrameCPP::Common::MemoryBufferT< BT >::buffer_type

◆ char_type [1/2]

template<typename BT = std::stringbuf>
typedef buffer_type::char_type FrameCPP::Common::MemoryBufferT< BT >::char_type

◆ char_type [2/2]

template<typename BT = std::stringbuf>
typedef buffer_type::char_type FrameCPP::Common::MemoryBufferT< BT >::char_type

◆ filters_type [1/2]

Type specifying the container holding the active filters.

◆ filters_type [2/2]

Type specifying the container holding the active filters.

Constructor & Destructor Documentation

◆ MemoryBufferT() [1/6]

template<typename BT = std::stringbuf>
FrameCPP::Common::MemoryBufferT< BT >::MemoryBufferT ( std::ios::openmode Mode,
const BT & Source,
bool ParentAutoDelete = true )

Default constructor.

Parameters
[in]SeedMethod use for input buffers to move data into the new instance.
[in]ParentAutoDeleteTrue if dynamic memory associated with the temporary buffer should be release once this object goes out of scope.
Returns
New class instance.

◆ MemoryBufferT() [2/6]

template<typename BT>
FrameCPP::Common::MemoryBufferT< BT >::MemoryBufferT ( std::ios::openmode Mode,
bool ParentAutoDelete = true )

Default constructor.

Parameters
[in]ModeSpecify the I/O mode of the buffer.
[in]ParentAutoDeleteTrue if dynamic memory associated with the temporary buffer should be release once this object goes out of scope.
Returns
New class instance.

The default constructor will initialize all the parts used in the general case.

◆ MemoryBufferT() [3/6]

template<typename BT>
FrameCPP::Common::MemoryBufferT< BT >::MemoryBufferT ( Seeder & Seed,
bool ParentAutoDelete = true )

Default constructor.

Parameters
[in]SeedMethod use for input buffers to move data into the new instance.
[in]ParentAutoDeleteTrue if dynamic memory associated with the temporary buffer should be release once this object goes out of scope.
Returns
New class instance.

The default constructor will initialize all the parts used in the general case.

◆ ~MemoryBufferT() [1/2]

template<typename BT>
FrameCPP::Common::MemoryBufferT< BT >::~MemoryBufferT ( )
virtual

Destructor.

Be careful to release all the resources that were created for this object.

◆ MemoryBufferT() [4/6]

template<typename BT = std::stringbuf>
FrameCPP::Common::MemoryBufferT< BT >::MemoryBufferT ( std::ios::openmode Mode,
const BT & Source,
bool ParentAutoDelete = true )

Default constructor.

Parameters
[in]SeedMethod use for input buffers to move data into the new instance.
[in]ParentAutoDeleteTrue if dynamic memory associated with the temporary buffer should be release once this object goes out of scope.
Returns
New class instance.

◆ MemoryBufferT() [5/6]

template<typename BT = std::stringbuf>
FrameCPP::Common::MemoryBufferT< BT >::MemoryBufferT ( std::ios::openmode Mode,
bool ParentAutoDelete = true )

Default constructor.

Parameters
[in]ModeSpecify the I/O mode of the buffer.
[in]ParentAutoDeleteTrue if dynamic memory associated with the temporary buffer should be release once this object goes out of scope.
Returns
New class instance.

◆ MemoryBufferT() [6/6]

template<typename BT = std::stringbuf>
FrameCPP::Common::MemoryBufferT< BT >::MemoryBufferT ( Seeder & Seed,
bool ParentAutoDelete = true )

Default constructor.

Parameters
[in]SeedMethod use for input buffers to move data into the new instance.
[in]ParentAutoDeleteTrue if dynamic memory associated with the temporary buffer should be release once this object goes out of scope.
Returns
New class instance.

◆ ~MemoryBufferT() [2/2]

template<typename BT = std::stringbuf>
virtual FrameCPP::Common::MemoryBufferT< BT >::~MemoryBufferT ( )
virtual

Destructor.

Member Function Documentation

◆ AutoDelete() [1/4]

bool FrameCPP::Common::FrameBufferInterface::AutoDelete ( ) const
inlineinherited

◆ AutoDelete() [2/4]

bool FrameCPP::Common::FrameBufferInterface::AutoDelete ( ) const
inherited

◆ AutoDelete() [3/4]

void FrameCPP::Common::FrameBufferInterface::AutoDelete ( bool Value)
inlineinherited

◆ AutoDelete() [4/4]

void FrameCPP::Common::FrameBufferInterface::AutoDelete ( bool Value)
inherited

◆ buffer() [1/2]

template<typename BT>
void FrameCPP::Common::MemoryBufferT< BT >::buffer ( )
protectedvirtual

Initialization of the buffer.

Implements FrameCPP::Common::FrameBufferInterface.

◆ buffer() [2/2]

template<typename BT = std::stringbuf>
virtual void FrameCPP::Common::MemoryBufferT< BT >::buffer ( )
protectedvirtual

Initialization of the buffer.

Implements FrameCPP::Common::FrameBufferInterface.

◆ BufferId() [1/2]

const std::string & FrameCPP::Common::FrameBufferInterface::BufferId ( ) const
inlineinherited

Retrieve the string identification of the buffer.

Returns
An identifier associated with the open buffer.

◆ BufferId() [2/2]

const std::string & FrameCPP::Common::FrameBufferInterface::BufferId ( ) const
inherited

Retrieve the string identification of the buffer.

Returns
An identifier associated with the open buffer.

◆ bufferId() [1/2]

void FrameCPP::Common::FrameBufferInterface::bufferId ( const std::string & Id)
inlineprotectedinherited

◆ bufferId() [2/2]

void FrameCPP::Common::FrameBufferInterface::bufferId ( const std::string & Id)
protectedinherited

◆ filter() [1/4]

virtual void FrameCPP::Common::FrameBufferInterface::filter ( const char_type * Start,
const char_type * End )
pure virtualinherited

◆ filter() [2/4]

template<class DT>
void FrameCPP::Common::FrameBufferInterface::filter ( const DT & Data)
inlineinherited

◆ filter() [3/4]

template<typename BT>
void FrameCPP::Common::MemoryBufferT< BT >::filter ( const char_type * Begin,
const char_type * End )
privatevirtual

Perform filtering operations on the stream.

◆ filter() [4/4]

template<typename BT = std::stringbuf>
virtual void FrameCPP::Common::MemoryBufferT< BT >::filter ( const char_type * Begin,
const char_type * End )
privatevirtual

Perform filtering operations on the stream.

◆ FilterAdd() [1/2]

void FrameCPP::Common::FrameBufferInterface::FilterAdd ( FrameCPP::Common::StreamFilter * Filter)
virtualinherited

◆ FilterAdd() [2/2]

virtual void FrameCPP::Common::FrameBufferInterface::FilterAdd ( FrameCPP::Common::StreamFilter * Filter)
virtualinherited

◆ FilterBuffer() [1/2]

void FrameCPP::Common::FrameBufferInterface::FilterBuffer ( const char * Begin,
const char * End )
inherited

◆ FilterBuffer() [2/2]

void FrameCPP::Common::FrameBufferInterface::FilterBuffer ( const char * Begin,
const char * End )
inherited

◆ FilterInternally() [1/2]

template<typename BT>
bool FrameCPP::Common::MemoryBufferT< BT >::FilterInternally ( ) const
virtual

Returns true if filtering happens internally; false otherwise.

Filtering currently is not optimized at the this layer so this method will always return false.

Implements FrameCPP::Common::FrameBufferInterface.

◆ FilterInternally() [2/2]

template<typename BT = std::stringbuf>
bool FrameCPP::Common::MemoryBufferT< BT >::FilterInternally ( ) const
virtual

Returns true if filtering happens internally; false otherwise.

Implements FrameCPP::Common::FrameBufferInterface.

◆ FilterRemove() [1/2]

void FrameCPP::Common::FrameBufferInterface::FilterRemove ( FrameCPP::Common::StreamFilter * Filter)
virtualinherited

◆ FilterRemove() [2/2]

virtual void FrameCPP::Common::FrameBufferInterface::FilterRemove ( FrameCPP::Common::StreamFilter * Filter)
virtualinherited

◆ setbuf() [1/2]

template<typename BT>
MemoryBufferT< BT > * FrameCPP::Common::MemoryBufferT< BT >::setbuf ( char_type * S,
std::streamsize N )
protectedvirtual

Routine to register if the caller has specified a buffer.

◆ setbuf() [2/2]

template<typename BT = std::stringbuf>
virtual MemoryBufferT * FrameCPP::Common::MemoryBufferT< BT >::setbuf ( char_type * S,
std::streamsize N )
protectedvirtual

Routine to register if the caller has specified a buffer.

◆ str() [1/4]

template<typename BT>
std::string FrameCPP::Common::MemoryBufferT< BT >::str ( )

◆ str() [2/4]

template<typename BT = std::stringbuf>
std::string FrameCPP::Common::MemoryBufferT< BT >::str ( )

◆ str() [3/4]

template<typename BT>
void FrameCPP::Common::MemoryBufferT< BT >::str ( const std::string & S)

◆ str() [4/4]

template<typename BT = std::stringbuf>
void FrameCPP::Common::MemoryBufferT< BT >::str ( const std::string & S)

Friends And Related Symbol Documentation

◆ IStream

template<typename BT = std::stringbuf>
IStream
friend

◆ OStream

template<typename BT = std::stringbuf>
OStream
friend

Member Data Documentation

◆ buffer_cache

template<typename BT = std::stringbuf>
boost::scoped_array< char_type > FrameCPP::Common::MemoryBufferT< BT >::buffer_cache
private

◆ buffer_user_supplied

template<typename BT = std::stringbuf>
bool FrameCPP::Common::MemoryBufferT< BT >::buffer_user_supplied
private

State of user supplied buffer.

◆ m_auto_delete

bool FrameCPP::Common::FrameBufferInterface::m_auto_delete
privateinherited

◆ M_BUFFER_SIZE_DEFAULT

static const buffer_size_type FrameCPP::Common::FrameBufferInterface::M_BUFFER_SIZE_DEFAULT = 256 * 1024
staticinherited

The default size for buffered input and output.

◆ M_BUFFER_SIZE_SYSTEM

static const buffer_size_type FrameCPP::Common::FrameBufferInterface::M_BUFFER_SIZE_SYSTEM
staticinherited
Initial value:
=
INT_4U buffer_size_type
Definition FrameBufferInterface.hh:163

◆ m_filters

filters_type FrameCPP::Common::FrameBufferInterface::m_filters
protectedinherited

Container holding all active filters.

◆ m_stream_id

std::string FrameCPP::Common::FrameBufferInterface::m_stream_id
privateinherited

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