Chemical Data Processing Library Python API - Version 1.2.0
Public Member Functions | Properties | List of all members
CDPL.Chem.MolecularGraphOutputHandler Class Reference

A factory interface providing methods for the creation of Chem.MolecularGraphWriterBase instances for data output in a particular storage format. More...

+ Inheritance diagram for CDPL.Chem.MolecularGraphOutputHandler:

Public Member Functions

None __init__ ()
 Initializes the MolecularGraphOutputHandler instance.
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
Base.DataFormat getDataFormat ()
 Returns a Base.DataFormat object that provides information about the handled output data format. More...
 
MolecularGraphWriterBase createWriter (Base.IOStream ios)
 Creates a MolecularGraphWriterBase instance that will write the data to the I/O stream ios. More...
 
MolecularGraphWriterBase createWriter (str file_name, OpenMode mode=Base.IOStream.OpenMode(60))
 Creates a MolecularGraphWriterBase instance that will write the data to the file specified by file_name. More...
 

Properties

 objectID = property(getObjectID)
 

Detailed Description

A factory interface providing methods for the creation of Chem.MolecularGraphWriterBase instances for data output in a particular storage format.

Member Function Documentation

◆ getObjectID()

int CDPL.Chem.MolecularGraphOutputHandler.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python MolecularGraphOutputHandler instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two MolecularGraphOutputHandler instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ getDataFormat()

Base.DataFormat CDPL.Chem.MolecularGraphOutputHandler.getDataFormat ( )

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]

MolecularGraphWriterBase CDPL.Chem.MolecularGraphOutputHandler.createWriter ( Base.IOStream  ios)

Creates a MolecularGraphWriterBase instance that will write the data to the I/O stream ios.

Parameters
iosThe I/O stream to write to.
Returns
The created MolecularGraphWriterBase instance.

◆ createWriter() [2/2]

MolecularGraphWriterBase CDPL.Chem.MolecularGraphOutputHandler.createWriter ( str  file_name,
OpenMode   mode = Base.IOStream.OpenMode(60) 
)

Creates a MolecularGraphWriterBase 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
The created MolecularGraphWriterBase instance.