Template Class FileHandlerBase

Inheritance Relationships

Base Type

  • private boost::noncopyable

Class Documentation

template<typename HandlerType>
class FileHandlerBase : private boost::noncopyable

Todo:

write docs

Public Types

typedef HandlerType handler_type

Public Functions

virtual ~FileHandlerBase()

Constructor.

inline FileFormats::Type get_type() const noexcept

Returns the type of the file.

inline handler_type &get_file_stream() noexcept

Returns the underlying file stream.

inline const handler_type &get_file_stream() const noexcept

Returns the underlying file stream.

inline std::string get_filename() const noexcept

Returns the filename that is used to write.

inline bool is_open() const noexcept

Return true if and only if the file is open.

virtual void close()

Close the file. Return true if and only if the file was closed successfully false otherwise.

virtual void open() = 0

Open the file.

Protected Functions

FileHandlerBase(const std::string &file_name, FileFormats::Type t)

protected Constructor so that explicit instantiation of the class fails

Protected Attributes

std::string file_name_

The name of the file to write.

const FileFormats::Type t_

The format of the file.

handler_type f_

The low level file handler.