Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | List of all members
CDPL::Base::DataInputHandler< T > Class Template Referenceabstract

A factory interface providing methods for the creation of Base::DataReader instances handling a particular object type and storage format. More...

#include <DataInputHandler.hpp>

+ Inheritance diagram for CDPL::Base::DataInputHandler< T >:

Public Types

typedef DataReader< T > ReaderType
 
typedef std::shared_ptr< DataInputHandlerSharedPointer
 

Public Member Functions

virtual ~DataInputHandler ()
 Virtual destructor. More...
 
virtual const DataFormatgetDataFormat () const =0
 Returns a Base::DataFormat object that provides information about the handled input data format. More...
 
virtual ReaderType::SharedPointer createReader (std::istream &is) const =0
 Creates a Base::DataReader instance that will read the data from the input stream is. More...
 
virtual ReaderType::SharedPointer createReader (const std::string &file_name, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::binary) const =0
 Creates a Base::DataReader instance that will read the data from the file specified by file_name. More...
 

Detailed Description

template<typename T>
class CDPL::Base::DataInputHandler< T >

A factory interface providing methods for the creation of Base::DataReader instances handling a particular object type and storage format.

Template Parameters
TThe type of objects handled by the created Base::DataReader instances.

Member Typedef Documentation

◆ ReaderType

template<typename T >
typedef DataReader<T> CDPL::Base::DataInputHandler< T >::ReaderType

◆ SharedPointer

template<typename T >
typedef std::shared_ptr<DataInputHandler> CDPL::Base::DataInputHandler< T >::SharedPointer

Constructor & Destructor Documentation

◆ ~DataInputHandler()

template<typename T >
virtual CDPL::Base::DataInputHandler< T >::~DataInputHandler ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ getDataFormat()

template<typename T >
virtual const DataFormat& CDPL::Base::DataInputHandler< T >::getDataFormat ( ) const
pure virtual

Returns a Base::DataFormat object that provides information about the handled input data format.

Returns
A Base::DataFormat object that provides information about the handled data format.

◆ createReader() [1/2]

template<typename T >
virtual ReaderType::SharedPointer CDPL::Base::DataInputHandler< T >::createReader ( std::istream &  is) const
pure virtual

Creates a Base::DataReader instance that will read the data from the input stream is.

Parameters
isThe input stream to read from.
Returns
A shared pointer to the created Base::DataReader instance.

Implemented in CDPL::Util::DefaultDataInputHandler< ReaderImpl, Format, DataType >, CDPL::Pharm::PSDPharmacophoreInputHandler, and CDPL::Pharm::PSDMoleculeInputHandler.

◆ createReader() [2/2]

template<typename T >
virtual ReaderType::SharedPointer CDPL::Base::DataInputHandler< T >::createReader ( const std::string &  file_name,
std::ios_base::openmode  mode = std::ios_base::in|std::ios_base::binary 
) const
pure virtual

Creates a Base::DataReader instance that will read the data from the file specified by file_name.

Parameters
file_nameThe full path of the file to read from.
modeFlags specifying the file open-mode.
Returns
A shared pointer to the created Base::DataReader instance.

Implemented in CDPL::Util::DefaultDataInputHandler< ReaderImpl, Format, DataType >, CDPL::Pharm::PSDPharmacophoreInputHandler, and CDPL::Pharm::PSDMoleculeInputHandler.


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