bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
bitrl::utils::io::FileHandlerBase< HandlerType > Class Template Referenceabstract

#include <file_handler_base.h>

Inheritance diagram for bitrl::utils::io::FileHandlerBase< HandlerType >:
Collaboration diagram for bitrl::utils::io::FileHandlerBase< HandlerType >:

Public Types

typedef HandlerType handler_type
 

Public Member Functions

virtual ~FileHandlerBase ()
 Constructor.
 
FileFormats::Type get_type () const noexcept
 Returns the type of the file.
 
handler_typeget_file_stream () noexcept
 Returns the underlying file stream.
 
const handler_typeget_file_stream () const noexcept
 Returns the underlying file stream.
 
std::string get_filename () const noexcept
 Returns the filename that is used to write.
 
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 Member 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.
 

Detailed Description

template<typename HandlerType>
class bitrl::utils::io::FileHandlerBase< HandlerType >
Todo:
write docs

Member Typedef Documentation

◆ handler_type

Constructor & Destructor Documentation

◆ ~FileHandlerBase()

◆ FileHandlerBase()

template<typename HandlerType >
bitrl::utils::io::FileHandlerBase< HandlerType >::FileHandlerBase ( const std::string &  file_name,
FileFormats::Type  t 
)
protected

protected Constructor so that explicit instantiation of the class fails

Member Function Documentation

◆ close()

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

◆ get_file_stream() [1/2]

template<typename HandlerType >
const handler_type & bitrl::utils::io::FileHandlerBase< HandlerType >::get_file_stream ( ) const
inlinenoexcept

Returns the underlying file stream.

◆ get_file_stream() [2/2]

template<typename HandlerType >
handler_type & bitrl::utils::io::FileHandlerBase< HandlerType >::get_file_stream ( )
inlinenoexcept

Returns the underlying file stream.

◆ get_filename()

template<typename HandlerType >
std::string bitrl::utils::io::FileHandlerBase< HandlerType >::get_filename ( ) const
inlinenoexcept

Returns the filename that is used to write.

◆ get_type()

template<typename HandlerType >
FileFormats::Type bitrl::utils::io::FileHandlerBase< HandlerType >::get_type ( ) const
inlinenoexcept

Returns the type of the file.

◆ is_open()

template<typename HandlerType >
bool bitrl::utils::io::FileHandlerBase< HandlerType >::is_open ( ) const
inlinenoexcept

Return true if and only if the file is open.

◆ open()

Member Data Documentation

◆ f_

The low level file handler.

◆ file_name_

template<typename HandlerType >
std::string bitrl::utils::io::FileHandlerBase< HandlerType >::file_name_
protected

The name of the file to write.

◆ t_

The format of the file.


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