29 #ifndef CDPL_BASE_DATAWRITER_HPP
30 #define CDPL_BASE_DATAWRITER_HPP
103 virtual operator const void*()
const = 0;
136 template <
typename T>
145 template <
typename T>
151 DataIOBase::operator=(writer);
158 template <
typename T>
161 return writer.
write(obj);
Definition of the class CDPL::Base::DataIOBase.
Provides infrastructure for the registration of I/O callback functions.
Definition: DataIOBase.hpp:59
An interface for writing data objects of a given type to an arbitrary data sink.
Definition: DataWriter.hpp:63
DataWriter & operator=(const DataWriter &writer)
Assignment operator.
Definition: DataWriter.hpp:146
virtual DataWriter & write(const DataType &obj)=0
Writes the data object obj.
T DataType
The type of the written data objects.
Definition: DataWriter.hpp:74
std::shared_ptr< DataWriter > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated DataWriter instances.
Definition: DataWriter.hpp:69
virtual bool operator!() const =0
Tells whether the writer is in a bad state.
virtual void close()
Writes format dependent data (if required) to mark the end of output.
Definition: DataWriter.hpp:88
DataWriter< T > & operator<<(DataWriter< T > &writer, const T &obj)
An output operator that outputs the data object obj by means of the Base::DataWriter instance writer.
constexpr unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
The namespace of the Chemical Data Processing Library.