Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
dpp::io_common Class Reference

Some common data structure for I/O modules. More...

#include <bayeux/dpp/io_common.h>

Public Types

enum  io_type { IO_INVALID = -1, IO_OUTPUT = 0, IO_INPUT = 1 }
 Input/output. More...
 
enum  format_type { FORMAT_INVALID = -1, FORMAT_BIO = 0, FORMAT_BRIO = 1 }
 Format of the storage. More...
 

Public Member Functions

 io_common (datatools::logger::priority &logging_, const std::string &module_name_)
 
virtual ~io_common ()
 
void set_module_name (const std::string &)
 
const std::string & get_module_name () const
 
format_type get_format () const
 
void set_format (format_type)
 
io_type get_io () const
 
void set_io (io_type)
 
void set_context_label (const std::string &)
 
const std::string & get_context_label () const
 
void set_context_service (dpp::context_service &context_service_, const std::string &ctx_label_="Ctx")
 
bool has_context_service () const
 
const dpp::context_serviceget_context_service () const
 
dpp::context_servicegrab_context_service ()
 
void add_context_metadata (const std::string &)
 
void set_context_all (bool val_)
 
void clear_context_metadata ()
 
void set_max_files (int max_files_)
 
int get_max_files () const
 
void set_max_record_total (int max_record_total_)
 
int get_max_record_total () const
 
void set_max_record_per_file (int max_record_per_file_)
 
int get_max_record_per_file () const
 
void init_filenames (const datatools::properties &setup_)
 
const datatools::smart_filenameget_filenames () const
 
datatools::smart_filenamegrab_filenames ()
 
bool is_terminated () const
 
void set_terminated (bool)
 
int get_file_record_counter () const
 
int get_record_counter () const
 
int get_file_index () const
 
void set_file_record_counter (int)
 
void set_record_counter (int)
 
void set_file_index (int)
 
void initialize (const datatools::properties &config_, datatools::service_manager &service_manager_)
 
void reset ()
 
const datatools::multi_propertiesget_metadata_store () const
 Return an embedded metadata store (const reference) More...
 
datatools::multi_propertiesgrab_metadata_store ()
 Return an embedded metadata store (mutable reference) More...
 
void clear_metadata_store ()
 Clear the contents of the embedded metadata store. More...
 
const std::vector< std::string > & get_context_metadata () const
 Return a const reference to the list of context metadata labels. More...
 
bool is_context_all () const
 Check if all context metadata are accepted. More...
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 

Static Public Member Functions

static format_type guess_format_from_filename (const std::string &)
 
static i_data_sourceallocate_reader (const std::string &, datatools::logger::priority)
 
static i_data_sinkallocate_writer (const std::string &, datatools::logger::priority)
 
static const std::string & metadata_key ()
 
static const std::string & metadata_meta ()
 
static const std::string & metadata_rank ()
 
static const std::string & metadata_topic ()
 
static const std::string & context_key ()
 
static const std::string & context_meta ()
 
static const std::string & context_rank ()
 
static const std::string & context_topic ()
 

Protected Member Functions

void _set_defaults ()
 

Detailed Description

Some common data structure for I/O modules.

Member Enumeration Documentation

◆ format_type

Format of the storage.

Enumerator
FORMAT_INVALID 
FORMAT_BIO 
FORMAT_BRIO 

◆ io_type

Input/output.

Enumerator
IO_INVALID 
IO_OUTPUT 
IO_INPUT 

Constructor & Destructor Documentation

◆ io_common()

dpp::io_common::io_common ( datatools::logger::priority logging_,
const std::string &  module_name_ 
)

◆ ~io_common()

virtual dpp::io_common::~io_common ( )
virtual

Member Function Documentation

◆ _set_defaults()

void dpp::io_common::_set_defaults ( )
protected

◆ add_context_metadata()

void dpp::io_common::add_context_metadata ( const std::string &  )

◆ allocate_reader()

static i_data_source* dpp::io_common::allocate_reader ( const std::string &  ,
datatools::logger::priority   
)
static

◆ allocate_writer()

static i_data_sink* dpp::io_common::allocate_writer ( const std::string &  ,
datatools::logger::priority   
)
static

◆ clear_context_metadata()

void dpp::io_common::clear_context_metadata ( )

◆ clear_metadata_store()

void dpp::io_common::clear_metadata_store ( )

Clear the contents of the embedded metadata store.

◆ context_key()

static const std::string& dpp::io_common::context_key ( )
static

◆ context_meta()

static const std::string& dpp::io_common::context_meta ( )
static

◆ context_rank()

static const std::string& dpp::io_common::context_rank ( )
static

◆ context_topic()

static const std::string& dpp::io_common::context_topic ( )
static

◆ get_context_label()

const std::string& dpp::io_common::get_context_label ( ) const

◆ get_context_metadata()

const std::vector<std::string>& dpp::io_common::get_context_metadata ( ) const

Return a const reference to the list of context metadata labels.

◆ get_context_service()

const dpp::context_service& dpp::io_common::get_context_service ( ) const

◆ get_file_index()

int dpp::io_common::get_file_index ( ) const

◆ get_file_record_counter()

int dpp::io_common::get_file_record_counter ( ) const

◆ get_filenames()

const datatools::smart_filename& dpp::io_common::get_filenames ( ) const

◆ get_format()

format_type dpp::io_common::get_format ( ) const

◆ get_io()

io_type dpp::io_common::get_io ( ) const

◆ get_max_files()

int dpp::io_common::get_max_files ( ) const

◆ get_max_record_per_file()

int dpp::io_common::get_max_record_per_file ( ) const

◆ get_max_record_total()

int dpp::io_common::get_max_record_total ( ) const

◆ get_metadata_store()

const datatools::multi_properties& dpp::io_common::get_metadata_store ( ) const

Return an embedded metadata store (const reference)

◆ get_module_name()

const std::string& dpp::io_common::get_module_name ( ) const

◆ get_record_counter()

int dpp::io_common::get_record_counter ( ) const

◆ grab_context_service()

dpp::context_service& dpp::io_common::grab_context_service ( )

◆ grab_filenames()

datatools::smart_filename& dpp::io_common::grab_filenames ( )

◆ grab_metadata_store()

datatools::multi_properties& dpp::io_common::grab_metadata_store ( )

Return an embedded metadata store (mutable reference)

◆ guess_format_from_filename()

static format_type dpp::io_common::guess_format_from_filename ( const std::string &  )
static

◆ has_context_service()

bool dpp::io_common::has_context_service ( ) const

◆ init_filenames()

void dpp::io_common::init_filenames ( const datatools::properties setup_)

◆ initialize()

void dpp::io_common::initialize ( const datatools::properties config_,
datatools::service_manager service_manager_ 
)

◆ is_context_all()

bool dpp::io_common::is_context_all ( ) const

Check if all context metadata are accepted.

◆ is_terminated()

bool dpp::io_common::is_terminated ( ) const

◆ metadata_key()

static const std::string& dpp::io_common::metadata_key ( )
static

◆ metadata_meta()

static const std::string& dpp::io_common::metadata_meta ( )
static

◆ metadata_rank()

static const std::string& dpp::io_common::metadata_rank ( )
static

◆ metadata_topic()

static const std::string& dpp::io_common::metadata_topic ( )
static

◆ reset()

void dpp::io_common::reset ( )

◆ set_context_all()

void dpp::io_common::set_context_all ( bool  val_)

◆ set_context_label()

void dpp::io_common::set_context_label ( const std::string &  )

◆ set_context_service()

void dpp::io_common::set_context_service ( dpp::context_service context_service_,
const std::string &  ctx_label_ = "Ctx" 
)

◆ set_file_index()

void dpp::io_common::set_file_index ( int  )

◆ set_file_record_counter()

void dpp::io_common::set_file_record_counter ( int  )

◆ set_format()

void dpp::io_common::set_format ( format_type  )

◆ set_io()

void dpp::io_common::set_io ( io_type  )

◆ set_max_files()

void dpp::io_common::set_max_files ( int  max_files_)

◆ set_max_record_per_file()

void dpp::io_common::set_max_record_per_file ( int  max_record_per_file_)

◆ set_max_record_total()

void dpp::io_common::set_max_record_total ( int  max_record_total_)

◆ set_module_name()

void dpp::io_common::set_module_name ( const std::string &  )

◆ set_record_counter()

void dpp::io_common::set_record_counter ( int  )

◆ set_terminated()

void dpp::io_common::set_terminated ( bool  )

◆ tree_dump()

virtual void dpp::io_common::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

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