Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Member Functions | List of all members
datatools::urn_query_service Class Reference

A service which allows queries about URNs thanks to embedded specialized dictionaries of URN informations and URN/path resolver tables. More...

#include <bayeux/datatools/urn_query_service.h>

Inheritance diagram for datatools::urn_query_service:
datatools::base_service datatools::enriched_base datatools::i_serializable datatools::i_tree_dumpable

Public Member Functions

 urn_query_service ()
 Default constructor. More...
 
virtual ~urn_query_service ()
 Destructor. More...
 
virtual bool is_initialized () const
 Check initialization status. More...
 
virtual int initialize (const datatools::properties &config_, datatools::service_dict_type &services_)
 Initialize the service from a list of properties. More...
 
virtual int reset ()
 Reset. More...
 
virtual void tree_dump (std::ostream &out=std::clog, const std::string &title="", const std::string &indent="", bool inherit=false) const
 Smart print. More...
 
bool check_urn_info (const std::string &urn_, const std::string &category_="") const
 Check if an URN information is defined. More...
 
bool find_urn_info (std::vector< std::string > &urn_list_, const std::string &urn_db_regex_="", const std::string &urn_regex_="", const std::string &urn_category_regex_="", bool clear_=true) const
 Build a list of URNs with requested URN and category patterns. More...
 
const urn_infoget_urn_info (const std::string &urn_) const
 Return a registered URN info. More...
 
bool find_urn_to_path (std::vector< std::string > &urn_path_list_, const std::string &urn_resolver_regex_="", const std::string &urn_regex_="", const std::string &urn_category_regex_="", const std::string &urn_mime_regex_="", bool clear_=true) const
 Build a list of URNs associated to path with requested URN and category patterns. More...
 
bool check_urn_to_path (const std::string &urn_) const
 Check if URN is associated to a path. More...
 
bool resolve_urn_to_path (const std::string &urn_, std::string &category_, std::string &mime_, std::string &path_) const
 
bool get_urn_to_path (const std::string &urn_, std::string &category_, std::string &mime_, std::string &path_) const
 Return the informations associated to a URN to path association. More...
 
bool has_db (const std::string &name_) const
 Check if an URN database with given name is registered. More...
 
bool has_db (const urn_db_service &) const
 Check if an URN database is registered. More...
 
const urn_db_serviceget_db (const std::string &name_) const
 Return an URN db service with a given name. More...
 
void build_list_of_dbs (std::set< std::string > &dbs_) const
 Build the list of URN databases. More...
 
void add_db (const urn_db_service &)
 Register an URN database. More...
 
void add_db (const urn_db_service &, const std::string &name_)
 Register an URN database with given name. More...
 
void remove_db (const urn_db_service &)
 Unregister an URN database. More...
 
void remove_db (const std::string &name_)
 Unregister an URN database with given name. More...
 
bool has_path_resolver (const std::string &name_) const
 Check if an URN path resolver with given name is registered. More...
 
void build_list_of_path_resolvers (std::set< std::string > &prs_) const
 Build the list of URN path resolvers. More...
 
bool has_path_resolver (const urn_to_path_resolver_service &) const
 Check if an URN path resolver is registered. More...
 
const urn_to_path_resolver_serviceget_path_resolver (const std::string &name_) const
 Return an URN path resolver service with a given name. More...
 
void add_path_resolver (const urn_to_path_resolver_service &)
 Register an URN path resolver. More...
 
void add_path_resolver (const urn_to_path_resolver_service &, const std::string &name_)
 Register an URN path resolver with given name. More...
 
void remove_path_resolver (const urn_to_path_resolver_service &)
 Unregister an URN path resolver. More...
 
void remove_path_resolver (const std::string &name_)
 Unregister an URN path resolver with given name. More...
 
const dependency_graphget_dependency_graph () const
 Return the auto-build dependency graph associated to the service. More...
 
void update_dependency_graph ()
 Return the auto-build dependency graph associated to the service. More...
 
- Public Member Functions inherited from datatools::base_service
 base_service ()
 Default constructor. More...
 
 base_service (const std::string &name_, const std::string &display_name_="", const std::string &description_="", logger::priority lp_=logger::PRIO_FATAL)
 Constructor. More...
 
virtual ~base_service ()
 Destructor. More...
 
virtual void fetch_dependencies (service_dependency_dict_type &) const
 Undocumented unused/unimplemented method. More...
 
virtual int initialize_simple ()
 Initialize the service without a list of properties nor other services. More...
 
virtual int initialize_standalone (const datatools::properties &config_)
 Initialize the service using only a list of properties without the needs of other services. More...
 
virtual int initialize_with_services (service_dict_type &service_dict_)
 Initialize the service using with access to a dictionary of other services. More...
 
virtual std::string service_class_id () const =0
 Return the service class. More...
 
void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const override
 Smart print. More...
 
- Public Member Functions inherited from datatools::enriched_base
virtual bool is_name_valid (const std::string &name_) const
 Check if a name is valid. More...
 
 enriched_base ()
 Default constructor. More...
 
 enriched_base (const std::string &name_, const std::string &display_name_="", const std::string &terse_description_="", logger::priority lp_=logger::PRIO_FATAL)
 Constructor. More...
 
virtual ~enriched_base ()
 Destructor. More...
 
bool has_name () const
 Check if the name is not empty. More...
 
void set_name (const std::string &name_)
 Set the name. More...
 
enriched_baseset_name_c (const std::string &name_)
 Set the name. More...
 
const std::string & get_name () const
 Return the name. More...
 
void reset_name ()
 Reset the name. More...
 
bool has_display_name () const
 Check if the display name is empty. More...
 
void set_display_name (const std::string &display_name_)
 Set the display name. More...
 
enriched_baseset_display_name_c (const std::string &display_name_)
 Set the display name. More...
 
const std::string & get_display_name () const
 Return the display name. More...
 
bool has_terse_description () const
 Check if the description is empty. More...
 
void set_terse_description (const std::string &terse_description_)
 Set the description. More...
 
enriched_baseset_terse_description_c (const std::string &terse_description_)
 Set the description. More...
 
const std::string & get_terse_description () const
 Return the description. More...
 
bool has_auxiliaries () const
 Check if the container of auxiliary properties is empty. More...
 
const datatools::propertiesget_auxiliaries () const
 Return a reference to the non mutable container of auxiliary properties. More...
 
datatools::propertiesgrab_auxiliaries ()
 Return a reference to the mutable container of auxiliary properties. More...
 
void reset_auxiliaries ()
 Remove all auxiliary properties. More...
 
bool is_debug () const
 Check the debug status. More...
 
void set_logging_priority (logger::priority lp_)
 Set the logging priority threshold. More...
 
enriched_baseset_logging_priority_c (logger::priority lp_)
 Set the logging priority threshold. More...
 
void set_logging (const std::string &label_)
 Set the logging priority threshold from a string. More...
 
logger::priority get_logging_priority () const
 Return the logging priority threshold. More...
 
void clear ()
 Clear. More...
 
void reset ()
 Clear. More...
 
void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const override
 Smart print. More...
 
void initialize (const datatools::properties &config_, bool clear_=false)
 Initialization from a container of properties. More...
 
void export_to_config (datatools::properties &config_, uint32_t flags_=EXPORT_CONFIG_DEFAULT, const std::string &prefix_="") const
 Export to a container of properties. More...
 
- Public Member Functions inherited from datatools::i_serializable
 i_serializable ()
 Default constructor. More...
 
virtual ~i_serializable ()
 Destructor. More...
 
virtual const std::string & get_serial_tag () const =0
 Return the serialization string identifier of the class. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Additional Inherited Members

- Public Types inherited from datatools::enriched_base
enum  export_config_flags {
  EXPORT_CONFIG_CLEAR = bit_mask::bit00, EXPORT_CONFIG_NAME = bit_mask::bit01, EXPORT_CONFIG_DISPLAY_NAME = bit_mask::bit02, EXPORT_CONFIG_TERSE_DESCRIPTION = bit_mask::bit03,
  EXPORT_CONFIG_LOGGING_PRIORITY = bit_mask::bit04, EXPORT_CONFIG_AUXILIARIES = bit_mask::bit05, EXPORT_CONFIG_DEFAULT, EXPORT_CONFIG_LAST = EXPORT_CONFIG_AUXILIARIES
}
 Flags for export to a container of properties. More...
 
- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 
- Static Public Member Functions inherited from datatools::base_service
static void common_ocd (datatools::object_configuration_description &ocd_)
 Basic OCD support shared by all inherited modules. More...
 
- Static Public Member Functions inherited from datatools::enriched_base
static bool validate_name (const std::string &candidate_name_)
 Validate a name. More...
 
static logger::priority default_logging_priority ()
 Return the default logging priority threshold. More...
 
static void init_ocd (datatools::object_configuration_description &)
 OCD support. More...
 
- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 
- Protected Member Functions inherited from datatools::base_service
void _common_initialize (const datatools::properties &config_)
 Common initialization of services. More...
 
void common_initialize (const datatools::properties &config_)
 

Detailed Description

A service which allows queries about URNs thanks to embedded specialized dictionaries of URN informations and URN/path resolver tables.

Constructor & Destructor Documentation

◆ urn_query_service()

datatools::urn_query_service::urn_query_service ( )

Default constructor.

◆ ~urn_query_service()

virtual datatools::urn_query_service::~urn_query_service ( )
virtual

Destructor.

Member Function Documentation

◆ add_db() [1/2]

void datatools::urn_query_service::add_db ( const urn_db_service )

Register an URN database.

◆ add_db() [2/2]

void datatools::urn_query_service::add_db ( const urn_db_service ,
const std::string &  name_ 
)

Register an URN database with given name.

◆ add_path_resolver() [1/2]

void datatools::urn_query_service::add_path_resolver ( const urn_to_path_resolver_service )

Register an URN path resolver.

◆ add_path_resolver() [2/2]

void datatools::urn_query_service::add_path_resolver ( const urn_to_path_resolver_service ,
const std::string &  name_ 
)

Register an URN path resolver with given name.

◆ build_list_of_dbs()

void datatools::urn_query_service::build_list_of_dbs ( std::set< std::string > &  dbs_) const

Build the list of URN databases.

◆ build_list_of_path_resolvers()

void datatools::urn_query_service::build_list_of_path_resolvers ( std::set< std::string > &  prs_) const

Build the list of URN path resolvers.

◆ check_urn_info()

bool datatools::urn_query_service::check_urn_info ( const std::string &  urn_,
const std::string &  category_ = "" 
) const

Check if an URN information is defined.

◆ check_urn_to_path()

bool datatools::urn_query_service::check_urn_to_path ( const std::string &  urn_) const

Check if URN is associated to a path.

◆ find_urn_info()

bool datatools::urn_query_service::find_urn_info ( std::vector< std::string > &  urn_list_,
const std::string &  urn_db_regex_ = "",
const std::string &  urn_regex_ = "",
const std::string &  urn_category_regex_ = "",
bool  clear_ = true 
) const

Build a list of URNs with requested URN and category patterns.

◆ find_urn_to_path()

bool datatools::urn_query_service::find_urn_to_path ( std::vector< std::string > &  urn_path_list_,
const std::string &  urn_resolver_regex_ = "",
const std::string &  urn_regex_ = "",
const std::string &  urn_category_regex_ = "",
const std::string &  urn_mime_regex_ = "",
bool  clear_ = true 
) const

Build a list of URNs associated to path with requested URN and category patterns.

◆ get_db()

const urn_db_service& datatools::urn_query_service::get_db ( const std::string &  name_) const

Return an URN db service with a given name.

◆ get_dependency_graph()

const dependency_graph& datatools::urn_query_service::get_dependency_graph ( ) const

Return the auto-build dependency graph associated to the service.

◆ get_path_resolver()

const urn_to_path_resolver_service& datatools::urn_query_service::get_path_resolver ( const std::string &  name_) const

Return an URN path resolver service with a given name.

◆ get_urn_info()

const urn_info& datatools::urn_query_service::get_urn_info ( const std::string &  urn_) const

Return a registered URN info.

◆ get_urn_to_path()

bool datatools::urn_query_service::get_urn_to_path ( const std::string &  urn_,
std::string &  category_,
std::string &  mime_,
std::string &  path_ 
) const

Return the informations associated to a URN to path association.

◆ has_db() [1/2]

bool datatools::urn_query_service::has_db ( const std::string &  name_) const

Check if an URN database with given name is registered.

◆ has_db() [2/2]

bool datatools::urn_query_service::has_db ( const urn_db_service ) const

Check if an URN database is registered.

◆ has_path_resolver() [1/2]

bool datatools::urn_query_service::has_path_resolver ( const std::string &  name_) const

Check if an URN path resolver with given name is registered.

◆ has_path_resolver() [2/2]

bool datatools::urn_query_service::has_path_resolver ( const urn_to_path_resolver_service ) const

Check if an URN path resolver is registered.

◆ initialize()

virtual int datatools::urn_query_service::initialize ( const datatools::properties config_,
datatools::service_dict_type services_ 
)
virtual

Initialize the service from a list of properties.

Implements datatools::base_service.

◆ is_initialized()

virtual bool datatools::urn_query_service::is_initialized ( ) const
virtual

Check initialization status.

Implements datatools::base_service.

◆ remove_db() [1/2]

void datatools::urn_query_service::remove_db ( const urn_db_service )

Unregister an URN database.

◆ remove_db() [2/2]

void datatools::urn_query_service::remove_db ( const std::string &  name_)

Unregister an URN database with given name.

◆ remove_path_resolver() [1/2]

void datatools::urn_query_service::remove_path_resolver ( const urn_to_path_resolver_service )

Unregister an URN path resolver.

◆ remove_path_resolver() [2/2]

void datatools::urn_query_service::remove_path_resolver ( const std::string &  name_)

Unregister an URN path resolver with given name.

◆ reset()

virtual int datatools::urn_query_service::reset ( )
virtual

Reset.

Implements datatools::base_service.

◆ resolve_urn_to_path()

bool datatools::urn_query_service::resolve_urn_to_path ( const std::string &  urn_,
std::string &  category_,
std::string &  mime_,
std::string &  path_ 
) const

Resolve an URN as a path (filesystem path, URL, database query...), possibly with category and MIME type

◆ tree_dump()

virtual void datatools::urn_query_service::tree_dump ( std::ostream &  out = std::clog,
const std::string &  title = "",
const std::string &  indent = "",
bool  inherit = false 
) const
virtual

Smart print.

Reimplemented from datatools::base_service.

◆ update_dependency_graph()

void datatools::urn_query_service::update_dependency_graph ( )

Return the auto-build dependency graph associated to the service.


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