Bayes Filters Library
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
bfl::Logger Class Reference

#include <Logger.h>

Inheritance diagram for bfl::Logger:
[legend]

Public Member Functions

virtual ~Logger () noexcept
 
bool enable_log (const std::string &folder_path, const std::string &file_name_prefix)
 
bool disable_log ()
 
std::string get_folder_path () const
 
std::string get_file_name_prefix () const
 
template<typename DatumType >
void logger (DatumType datum)
 
template<typename... DataType>
void logger (DataType... data)
 
template<typename DatumType >
void logger (DatumType datum) const
 
template<typename... DataType>
void logger (DataType... data) const
 

Protected Member Functions

virtual std::vector< std::string > log_file_names (const std::string &folder_path, const std::string &file_name_prefix)
 
virtual void log ()
 

Private Member Functions

template<typename DatumType >
void logger_helper (const size_t pos, DatumType datum)
 
template<typename DatumType , typename... DataType>
void logger_helper (const size_t pos, DatumType datum, DataType... data)
 
template<typename DatumType >
void logger_helper (const size_t pos, DatumType datum) const
 
template<typename DatumType , typename... DataType>
void logger_helper (const size_t pos, DatumType datum, DataType... data) const
 

Private Attributes

std::string folder_path_
 
std::string file_name_prefix_
 
std::vector< std::string > file_names_
 
bool log_enabled_ = false
 
std::vector< std::ofstream > log_files_
 

Detailed Description

Definition at line 21 of file Logger.h.

Constructor & Destructor Documentation

◆ ~Logger()

Logger::~Logger ( )
virtualnoexcept

Definition at line 15 of file Logger.cpp.

References disable_log(), and log_enabled_.

Here is the call graph for this function:

Member Function Documentation

◆ disable_log()

bool Logger::disable_log ( )

Definition at line 68 of file Logger.cpp.

References file_names_, log_enabled_, and log_files_.

Referenced by ~Logger().

◆ enable_log()

bool Logger::enable_log ( const std::string &  folder_path,
const std::string &  file_name_prefix 
)

Definition at line 22 of file Logger.cpp.

References file_name_prefix_, file_names_, folder_path_, log_enabled_, log_file_names(), and log_files_.

Here is the call graph for this function:

◆ get_file_name_prefix()

std::string Logger::get_file_name_prefix ( ) const

Definition at line 91 of file Logger.cpp.

References file_name_prefix_.

◆ get_folder_path()

std::string Logger::get_folder_path ( ) const

Definition at line 85 of file Logger.cpp.

References folder_path_.

◆ log()

void Logger::log ( )
protectedvirtual

Reimplemented in bfl::SimulatedStateModel, bfl::SIS, and bfl::SimulatedLinearSensor.

Definition at line 109 of file Logger.cpp.

◆ log_file_names()

std::vector< std::string > Logger::log_file_names ( const std::string &  folder_path,
const std::string &  file_name_prefix 
)
protectedvirtual

Reimplemented in bfl::LinearModel, bfl::SimulatedStateModel, and bfl::SIS.

Definition at line 97 of file Logger.cpp.

Referenced by enable_log().

◆ logger() [1/4]

template<typename... DataType>
void bfl::Logger::logger ( DataType...  data)
inline

Definition at line 42 of file Logger.h.

References log_enabled_, and logger_helper().

Here is the call graph for this function:

◆ logger() [2/4]

template<typename... DataType>
void bfl::Logger::logger ( DataType...  data) const
inline

Definition at line 56 of file Logger.h.

References log_enabled_, and logger_helper().

Here is the call graph for this function:

◆ logger() [3/4]

template<typename DatumType >
void bfl::Logger::logger ( DatumType  datum)
inline

Definition at line 35 of file Logger.h.

References log_enabled_, and log_files_.

Referenced by bfl::SimulatedLinearSensor::log().

◆ logger() [4/4]

template<typename DatumType >
void bfl::Logger::logger ( DatumType  datum) const
inline

Definition at line 49 of file Logger.h.

References log_enabled_, and log_files_.

◆ logger_helper() [1/4]

template<typename DatumType >
void bfl::Logger::logger_helper ( const size_t  pos,
DatumType  datum 
)
inlineprivate

Definition at line 81 of file Logger.h.

References log_files_.

Referenced by logger(), and logger_helper().

◆ logger_helper() [2/4]

template<typename DatumType >
void bfl::Logger::logger_helper ( const size_t  pos,
DatumType  datum 
) const
inlineprivate

Definition at line 95 of file Logger.h.

References log_files_.

◆ logger_helper() [3/4]

template<typename DatumType , typename... DataType>
void bfl::Logger::logger_helper ( const size_t  pos,
DatumType  datum,
DataType...  data 
)
inlineprivate

Definition at line 87 of file Logger.h.

References log_files_, and logger_helper().

Here is the call graph for this function:

◆ logger_helper() [4/4]

template<typename DatumType , typename... DataType>
void bfl::Logger::logger_helper ( const size_t  pos,
DatumType  datum,
DataType...  data 
) const
inlineprivate

Definition at line 101 of file Logger.h.

References log_files_, and logger_helper().

Here is the call graph for this function:

Member Data Documentation

◆ file_name_prefix_

std::string bfl::Logger::file_name_prefix_
private

Definition at line 72 of file Logger.h.

Referenced by enable_log(), and get_file_name_prefix().

◆ file_names_

std::vector<std::string> bfl::Logger::file_names_
private

Definition at line 74 of file Logger.h.

Referenced by disable_log(), and enable_log().

◆ folder_path_

std::string bfl::Logger::folder_path_
private

Definition at line 70 of file Logger.h.

Referenced by enable_log(), and get_folder_path().

◆ log_enabled_

bool bfl::Logger::log_enabled_ = false
private

Definition at line 76 of file Logger.h.

Referenced by disable_log(), enable_log(), logger(), and ~Logger().

◆ log_files_

std::vector<std::ofstream> bfl::Logger::log_files_
mutableprivate

Definition at line 78 of file Logger.h.

Referenced by disable_log(), enable_log(), logger(), and logger_helper().


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