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

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

#include <DataOutputHandler.hpp>

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

Public Types

typedef DataWriter< T > WriterType
 
typedef std::shared_ptr< DataOutputHandlerSharedPointer
 

Public Member Functions

virtual ~DataOutputHandler ()
 Virtual destructor. More...
 
virtual const DataFormatgetDataFormat () const =0
 Returns a Base::DataFormat object that provides information about the handled output data format. More...
 
virtual WriterType::SharedPointer createWriter (std::iostream &ios) const =0
 Creates a Base::DataWriter instance that will write the data to the I/O stream ios. More...
 
virtual WriterType::SharedPointer createWriter (const std::string &file_name, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out|std::ios_base::trunc|std::ios_base::binary) const =0
 Creates a Base::DataWriter instance that will write the data to the file specified by file_name. More...
 

Detailed Description

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

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

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

Member Typedef Documentation

◆ WriterType

template<typename T >
typedef DataWriter<T> CDPL::Base::DataOutputHandler< T >::WriterType

◆ SharedPointer

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

Constructor & Destructor Documentation

◆ ~DataOutputHandler()

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

Virtual destructor.

Member Function Documentation

◆ getDataFormat()

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

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

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

◆ createWriter() [1/2]

template<typename T >
virtual WriterType::SharedPointer CDPL::Base::DataOutputHandler< T >::createWriter ( std::iostream &  ios) const
pure virtual

Creates a Base::DataWriter instance that will write the data to the I/O stream ios.

Parameters
iosThe I/O stream to write to.
Returns
A shared pointer to the created Base::DataWriter instance.

Implemented in CDPL::Util::DefaultDataOutputHandler< WriterImpl, FORMAT, DataType >, and CDPL::Pharm::PSDMolecularGraphOutputHandler.

◆ createWriter() [2/2]

template<typename T >
virtual WriterType::SharedPointer CDPL::Base::DataOutputHandler< T >::createWriter ( const std::string &  file_name,
std::ios_base::openmode  mode = std::ios_base::in|std::ios_base::out|std::ios_base::trunc|std::ios_base::binary 
) const
pure virtual

Creates a Base::DataWriter instance that will write the data to the file specified by file_name.

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

Implemented in CDPL::Util::DefaultDataOutputHandler< WriterImpl, FORMAT, DataType >, and CDPL::Pharm::PSDMolecularGraphOutputHandler.


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