30 #ifndef DPP_IO_COMMON_H 31 #define DPP_IO_COMMON_H 1 45 class context_service;
93 const std::string & module_name_);
114 const std::string & ctx_label_ =
"Ctx");
182 virtual void tree_dump (std::ostream & out_ = std::clog,
183 const std::string & title_ =
"",
184 const std::string & indent_ =
"",
185 bool inherit_ =
false)
const;
194 std::string _module_name_;
198 int _max_record_per_file_;
199 int _max_record_total_;
205 int _file_record_counter_;
206 int _record_counter_;
213 std::string _Ctx_label_;
215 std::vector<std::string> _Ctx_metadata_;
216 bool _Ctx_metadata_all_;
222 #endif // DPP_IO_COMMON_H const datatools::multi_properties & get_metadata_store() const
Return an embedded metadata store (const reference)
void set_max_record_per_file(int max_record_per_file_)
static const std::string & context_topic()
datatools::smart_filename & grab_filenames()
void set_module_name(const std::string &)
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
dpp::context_service & grab_context_service()
Definition: io_common.h:58
datatools::multi_properties & grab_metadata_store()
Return an embedded metadata store (mutable reference)
Top-level namespace of the Bayeux/dpp module library.
Definition: base_module.h:56
A service that handles a context object store implemented as a datatools::multi_properties container.
Definition: context_service.h:53
static const std::string & metadata_key()
bool has_context_service() const
bool is_terminated() const
void set_record_counter(int)
io_common(datatools::logger::priority &logging_, const std::string &module_name_)
void add_context_metadata(const std::string &)
void set_context_all(bool val_)
void set_max_record_total(int max_record_total_)
void set_max_files(int max_files_)
bool is_context_all() const
Check if all context metadata are accepted.
static const std::string & metadata_rank()
static const std::string & metadata_topic()
void set_file_record_counter(int)
int get_max_files() const
void set_terminated(bool)
Definition: io_common.h:64
Definition: io_common.h:56
Some common data structure for I/O modules.
Definition: io_common.h:50
format_type get_format() const
Definition: io_common.h:63
void clear_metadata_store()
Clear the contents of the embedded metadata store.
void set_context_service(dpp::context_service &context_service_, const std::string &ctx_label_="Ctx")
void set_format(format_type)
int get_record_counter() const
Data source/reader abstract interface.
Definition: i_data_source.h:50
int get_max_record_total() const
static const std::string & context_rank()
void init_filenames(const datatools::properties &setup_)
static const std::string & context_key()
static i_data_source * allocate_reader(const std::string &, datatools::logger::priority)
int get_max_record_per_file() const
const dpp::context_service & get_context_service() const
const std::string & get_module_name() const
static i_data_sink * allocate_writer(const std::string &, datatools::logger::priority)
int get_file_record_counter() const
const datatools::smart_filename & get_filenames() const
Data sink/writer abstract interface.
Definition: i_data_sink.h:49
io_type
Input/output.
Definition: io_common.h:55
Utilities for logging information.
int get_file_index() const
static format_type guess_format_from_filename(const std::string &)
format_type
Format of the storage.
Definition: io_common.h:62
Definition: io_common.h:65
const std::string & get_context_label() const
void set_context_label(const std::string &)
void initialize(const datatools::properties &config_, datatools::service_manager &service_manager_)
static const std::string & context_meta()
void clear_context_metadata()
static const std::string & metadata_meta()
Definition: io_common.h:57
const std::vector< std::string > & get_context_metadata() const
Return a const reference to the list of context metadata labels.