1 #ifndef _MADARA_FILTERS_FRAGMENTS_TO_FILES_FILTER_H_
2 #define _MADARA_FILTERS_FRAGMENTS_TO_FILES_FILTER_H_
4 #ifndef BOOST_NO_CXX11_SCOPED_ENUMS
5 #define BOOST_NO_CXX11_SCOPED_ENUMS
17 #include "madara/MadaraExport.h"
60 "FragmentsToFilesFilter::set_dir_mapping: "
61 "attempting to map %s -> %s\n",
62 variable_prefix.c_str(), directory.c_str())
64 if (variable_prefix !=
"" && directory !=
"")
66 map_[variable_prefix] = directory;
77 auto found =
map_.find(variable_prefix);
79 if (found !=
map_.end())
111 std::map<std::string, std::string>
map_;
#define madara_logger_ptr_log(loggering, level,...)
Fast version of the madara::logger::log method for Logger pointers.
Abstract base class for implementing aggregate record filters via a functor interface.
Receives fragments and saves them to files.
std::map< std::string, std::string > map_
map of variable prefixes to directories
FragmentsToFilesFilter()
Constructor.
bool clear_fragments_
if true, clear fragments after sent to file
std::string get_dir_mapping(const std::string &variable_prefix)
Gets the directory associated with the variable prefix.
void enable_clear_fragments(void)
Enables the clear fragments flag.
void set_dir_mapping(const std::string &variable_prefix, const std::string &directory)
Sets a mapping between a variable prefix and a directory.
void disable_clear_fragments(void)
Disables the clear fragments flag.
virtual MADARA_EXPORT void filter(knowledge::KnowledgeMap &records, const transport::TransportContext &, knowledge::Variables &)
Filters the fragments and converts them to files.
virtual ~FragmentsToFilesFilter()=default
Destructor.
Provides an interface for external functions into the MADARA KaRL variable settings.
Provides context about the transport.
T get(const KnowledgeRecord &kr)
Get the value of a KnowlegeRecord.
::std::map< std::string, KnowledgeRecord > KnowledgeMap
MADARA_EXPORT utility::Refcounter< logger::Logger > global_logger
Copyright(c) 2020 Galois.