cgul_block_reader_cxx Class Referenceabstract

#include <cgul_block_reader_cxx.h>

Inheritance diagram for cgul_block_reader_cxx:
Inheritance graph
Collaboration diagram for cgul_block_reader_cxx:
Collaboration graph

Public Member Functions

virtual ~cgul_block_reader_cxx ()
 
virtual size_t read_next_block (void *block, size_t block_size)=0
 
virtual const char * get_presentation_name () const =0
 
virtual void set_presentation_name (const char *presentation_name)=0
 
virtual cgul_block_reader_t as_block_reader () const =0
 

Detailed Description

This class provides a proper C++ abstract base class for the cgul_block_reader interface.

See also
cgul_block_reader_file_cxx
cgul_block_reader_memory_cxx

Constructor & Destructor Documentation

§ ~cgul_block_reader_cxx()

virtual cgul_block_reader_cxx::~cgul_block_reader_cxx ( )
inlinevirtual

Member Function Documentation

§ read_next_block()

virtual size_t cgul_block_reader_cxx::read_next_block ( void *  block,
size_t  block_size 
)
pure virtual

Virtual method that reads one block of data block of size block_size bytes from an external data source. The user is responsible for making sure block points to at least block_size contiguous bytes of memory. This method returns the number of bytes read or 0 if EOF is reached without error. If an error occurs, 0 is returned, and an exception is thrown.

Parameters
[in]blockblock
[in]block_sizeblock size in bytes
Returns
number of bytes read

Implemented in cgul_block_reader_file_cxx, and cgul_block_reader_memory_cxx.

Referenced by ~cgul_block_reader_cxx().

§ get_presentation_name()

virtual const char* cgul_block_reader_cxx::get_presentation_name ( ) const
pure virtual

Virtual method that returns the presentation name.

Returns
presentation name

Implemented in cgul_block_reader_file_cxx, and cgul_block_reader_memory_cxx.

Referenced by ~cgul_block_reader_cxx().

§ set_presentation_name()

virtual void cgul_block_reader_cxx::set_presentation_name ( const char *  presentation_name)
pure virtual

Virtual method that sets the presentation name. The presentation name is primarily used for error reporting and can be set to anything, but it does need to be set again if the input source changes. An exception is thrown if an attempt is made to set the presentation name without first setting the input source.

Parameters
[in]presentation_namepresentation name

Implemented in cgul_block_reader_file_cxx, and cgul_block_reader_memory_cxx.

Referenced by ~cgul_block_reader_cxx().

§ as_block_reader()

virtual cgul_block_reader_t cgul_block_reader_cxx::as_block_reader ( ) const
pure virtual

Return the underlying cgul_block_reader object.

Note
Most of the C++ wrappers for cgul have a method called get_obj() which is similar to this method except it returns a pointer to the most derived class; whereas, this method returns the same pointer but cast to the base class.
Returns
underlying cgul_block_reader object

Implemented in cgul_block_reader_file_cxx, and cgul_block_reader_memory_cxx.

Referenced by cgul_stream_reader_cxx::add_block_reader(), cgul_stream_reader_cxx::cgul_stream_reader_cxx(), and ~cgul_block_reader_cxx().


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