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

#include <FilteringAlgorithm.h>

Inheritance diagram for bfl::FilteringAlgorithm:
[legend]

Public Member Functions

virtual ~FilteringAlgorithm () noexcept=default
 
bool boot () override
 
void run () override
 
bool wait () override
 
void reset () override
 
void reboot () override
 
bool teardown () override
 
unsigned int step_number () override
 
bool is_running () override
 
virtual bool skip (const std::string &what_step, const bool status)=0
 
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

 FilteringAlgorithm ()=default
 
 FilteringAlgorithm (const FilteringAlgorithm &filter) noexcept=delete
 
FilteringAlgorithmoperator= (const FilteringAlgorithm &filter) noexcept=delete
 
 FilteringAlgorithm (FilteringAlgorithm &&filter) noexcept=delete
 
FilteringAlgorithmoperator= (FilteringAlgorithm &&filter) noexcept=delete
 
virtual bool initialization_step ()=0
 
virtual void filtering_step ()=0
 
virtual bool run_condition ()=0
 
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

void filtering_recursion ()
 
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

unsigned int filtering_step_ = 0
 
std::thread filtering_thread_
 
std::mutex mtx_run_
 
std::condition_variable cv_run_
 
bool run_ = false
 
bool reset_ = false
 
bool teardown_ = false
 
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 26 of file FilteringAlgorithm.h.

Constructor & Destructor Documentation

◆ ~FilteringAlgorithm()

virtual bfl::FilteringAlgorithm::~FilteringAlgorithm ( )
virtualdefaultnoexcept

◆ FilteringAlgorithm() [1/3]

bfl::FilteringAlgorithm::FilteringAlgorithm ( )
protecteddefault

◆ FilteringAlgorithm() [2/3]

bfl::FilteringAlgorithm::FilteringAlgorithm ( const FilteringAlgorithm filter)
protecteddeletenoexcept

◆ FilteringAlgorithm() [3/3]

bfl::FilteringAlgorithm::FilteringAlgorithm ( FilteringAlgorithm &&  filter)
protecteddeletenoexcept

Member Function Documentation

◆ boot()

bool FilteringAlgorithm::boot ( )
overridevirtual

Implements bfl::Filter.

Definition at line 15 of file FilteringAlgorithm.cpp.

References filtering_recursion(), and filtering_thread_.

Here is the call graph for this function:

◆ disable_log()

bool Logger::disable_log ( )
inherited

◆ enable_log()

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

Definition at line 22 of file Logger.cpp.

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

Here is the call graph for this function:

◆ filtering_recursion()

void FilteringAlgorithm::filtering_recursion ( )
private

Definition at line 102 of file FilteringAlgorithm.cpp.

References cv_run_, filtering_step(), filtering_step_, initialization_step(), mtx_run_, reset_, run_, run_condition(), and teardown_.

Referenced by boot().

Here is the call graph for this function:

◆ filtering_step()

virtual void bfl::FilteringAlgorithm::filtering_step ( )
protectedpure virtual

Implemented in bfl::SIS.

Referenced by filtering_recursion().

◆ get_file_name_prefix()

std::string Logger::get_file_name_prefix ( ) const
inherited

Definition at line 91 of file Logger.cpp.

References bfl::Logger::file_name_prefix_.

◆ get_folder_path()

std::string Logger::get_folder_path ( ) const
inherited

Definition at line 85 of file Logger.cpp.

References bfl::Logger::folder_path_.

◆ initialization_step()

virtual bool bfl::FilteringAlgorithm::initialization_step ( )
protectedpure virtual

Implemented in bfl::SIS.

Referenced by filtering_recursion().

◆ is_running()

bool FilteringAlgorithm::is_running ( )
overridevirtual

Implements bfl::Filter.

Definition at line 96 of file FilteringAlgorithm.cpp.

References run_.

◆ log()

void Logger::log ( )
protectedvirtualinherited

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 
)
protectedvirtualinherited

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

Definition at line 97 of file Logger.cpp.

Referenced by bfl::Logger::enable_log().

◆ logger() [1/4]

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

Definition at line 42 of file Logger.h.

References bfl::Logger::log_enabled_, and bfl::Logger::logger_helper().

Here is the call graph for this function:

◆ logger() [2/4]

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

Definition at line 56 of file Logger.h.

References bfl::Logger::log_enabled_, and bfl::Logger::logger_helper().

Here is the call graph for this function:

◆ logger() [3/4]

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

Definition at line 35 of file Logger.h.

References bfl::Logger::log_enabled_, and bfl::Logger::log_files_.

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

◆ logger() [4/4]

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

Definition at line 49 of file Logger.h.

References bfl::Logger::log_enabled_, and bfl::Logger::log_files_.

◆ logger_helper() [1/4]

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

Definition at line 81 of file Logger.h.

References bfl::Logger::log_files_.

Referenced by bfl::Logger::logger(), and bfl::Logger::logger_helper().

◆ logger_helper() [2/4]

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

Definition at line 95 of file Logger.h.

References bfl::Logger::log_files_.

◆ logger_helper() [3/4]

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

Definition at line 87 of file Logger.h.

References bfl::Logger::log_files_, and bfl::Logger::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
inlineprivateinherited

Definition at line 101 of file Logger.h.

References bfl::Logger::log_files_, and bfl::Logger::logger_helper().

Here is the call graph for this function:

◆ operator=() [1/2]

FilteringAlgorithm& bfl::FilteringAlgorithm::operator= ( const FilteringAlgorithm filter)
protecteddeletenoexcept

◆ operator=() [2/2]

FilteringAlgorithm& bfl::FilteringAlgorithm::operator= ( FilteringAlgorithm &&  filter)
protecteddeletenoexcept

◆ reboot()

void FilteringAlgorithm::reboot ( )
overridevirtual

Implements bfl::Filter.

Definition at line 73 of file FilteringAlgorithm.cpp.

References cv_run_, mtx_run_, reset_, and run_.

◆ reset()

void FilteringAlgorithm::reset ( )
overridevirtual

Implements bfl::Filter.

Definition at line 67 of file FilteringAlgorithm.cpp.

References reset_.

◆ run()

void FilteringAlgorithm::run ( )
overridevirtual

Implements bfl::Filter.

Definition at line 33 of file FilteringAlgorithm.cpp.

References cv_run_, mtx_run_, and run_.

◆ run_condition()

virtual bool bfl::FilteringAlgorithm::run_condition ( )
protectedpure virtual

Implemented in bfl::SIS.

Referenced by filtering_recursion().

◆ skip()

virtual bool bfl::Skipper::skip ( const std::string &  what_step,
const bool  status 
)
pure virtualinherited

◆ step_number()

unsigned int FilteringAlgorithm::step_number ( )
overridevirtual

Implements bfl::Filter.

Definition at line 90 of file FilteringAlgorithm.cpp.

References filtering_step_.

◆ teardown()

bool FilteringAlgorithm::teardown ( )
overridevirtual

Implements bfl::Filter.

Definition at line 82 of file FilteringAlgorithm.cpp.

References teardown_.

◆ wait()

bool FilteringAlgorithm::wait ( )
overridevirtual

Implements bfl::Filter.

Definition at line 41 of file FilteringAlgorithm.cpp.

References filtering_thread_.

Member Data Documentation

◆ cv_run_

std::condition_variable bfl::FilteringAlgorithm::cv_run_
private

Definition at line 75 of file FilteringAlgorithm.h.

Referenced by filtering_recursion(), reboot(), and run().

◆ file_name_prefix_

std::string bfl::Logger::file_name_prefix_
privateinherited

Definition at line 72 of file Logger.h.

Referenced by bfl::Logger::enable_log(), and bfl::Logger::get_file_name_prefix().

◆ file_names_

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

Definition at line 74 of file Logger.h.

Referenced by bfl::Logger::disable_log(), and bfl::Logger::enable_log().

◆ filtering_step_

unsigned int bfl::FilteringAlgorithm::filtering_step_ = 0
private

Definition at line 69 of file FilteringAlgorithm.h.

Referenced by filtering_recursion(), and step_number().

◆ filtering_thread_

std::thread bfl::FilteringAlgorithm::filtering_thread_
private

Definition at line 71 of file FilteringAlgorithm.h.

Referenced by boot(), and wait().

◆ folder_path_

std::string bfl::Logger::folder_path_
privateinherited

Definition at line 70 of file Logger.h.

Referenced by bfl::Logger::enable_log(), and bfl::Logger::get_folder_path().

◆ log_enabled_

bool bfl::Logger::log_enabled_ = false
privateinherited

◆ log_files_

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

◆ mtx_run_

std::mutex bfl::FilteringAlgorithm::mtx_run_
private

Definition at line 73 of file FilteringAlgorithm.h.

Referenced by filtering_recursion(), reboot(), and run().

◆ reset_

bool bfl::FilteringAlgorithm::reset_ = false
private

Definition at line 79 of file FilteringAlgorithm.h.

Referenced by filtering_recursion(), reboot(), and reset().

◆ run_

bool bfl::FilteringAlgorithm::run_ = false
private

Definition at line 77 of file FilteringAlgorithm.h.

Referenced by filtering_recursion(), is_running(), reboot(), and run().

◆ teardown_

bool bfl::FilteringAlgorithm::teardown_ = false
private

Definition at line 81 of file FilteringAlgorithm.h.

Referenced by filtering_recursion(), and teardown().


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