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

Internal entry for service objects stored in the service manager class. More...

#include <bayeux/datatools/service_tools.h>

Inheritance diagram for datatools::service_entry:
datatools::i_tree_dumpable

Public Types

enum  status_type { STATUS_BLANK = 0, STATUS_CREATED = datatools::bit_mask::bit00, STATUS_INITIALIZED = datatools::bit_mask::bit01, STATUS_BROKEN_DEPENDENCY = datatools::bit_mask::bit02 }
 Service status flags. 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...
 

Public Member Functions

 service_entry ()
 Default constructor. More...
 
 service_entry (const std::string &name_, service_manager &mgr_)
 Constructor. More...
 
 ~service_entry ()
 Destructor. More...
 
const std::string & get_service_name () const
 Return the service name. More...
 
void set_service_name (const std::string &)
 Set the service name. More...
 
const std::string & get_service_id () const
 Return the service identifier. More...
 
void set_service_id (const std::string &)
 Set the service identifier. More...
 
const datatools::propertiesget_service_config () const
 Return a reference to the non mutable service configuration. More...
 
datatools::propertiesgrab_service_config ()
 Return a reference to the mutable service configuration. More...
 
void set_service_config (const datatools::properties &)
 Set the service configuration. More...
 
bool can_be_dropped () const
 Check if service can be dropped. More...
 
uint32_t get_service_status () const
 Return the service status. More...
 
void update_service_status (uint32_t)
 Update the service status. More...
 
void reset_service_status (uint32_t)
 Reset the service status. More...
 
bool is_created () const
 Check if the service object is instantiated. More...
 
bool is_initialized () const
 Check if the service object is initialized. More...
 
bool has_master (const std::string &name_) const
 Check if the service object has master service with given name. 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...
 
const service_handle_typeget_service_handle () const
 Return a handle to the non mutable service. More...
 
service_handle_typegrab_service_handle ()
 Return a handle to the mutable service. More...
 
bool has_service_manager () const
 Check if service manager is available. More...
 
void set_service_manager (service_manager &smgr_)
 Set the service manager. More...
 
const service_managerget_service_manager () const
 Return a reference to the service manager. More...
 
service_managergrab_service_manager ()
 Return a mutable reference to the service manager. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. 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
 

Public Attributes

service_dependency_dict_type service_masters
 The list of services the service depends on (by names) More...
 

Additional Inherited Members

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

Detailed Description

Internal entry for service objects stored in the service manager class.

Record that handles a dynamically allocated and initialized service and additional informations

Member Enumeration Documentation

◆ status_type

Service status flags.

Enumerator
STATUS_BLANK 

Empty flag.

STATUS_CREATED 

Creation/instantiation flag.

STATUS_INITIALIZED 

Initialization flag.

STATUS_BROKEN_DEPENDENCY 

Broken dependency flag.

Constructor & Destructor Documentation

◆ service_entry() [1/2]

datatools::service_entry::service_entry ( )

Default constructor.

◆ service_entry() [2/2]

datatools::service_entry::service_entry ( const std::string &  name_,
service_manager mgr_ 
)

Constructor.

◆ ~service_entry()

datatools::service_entry::~service_entry ( )

Destructor.

Member Function Documentation

◆ can_be_dropped()

bool datatools::service_entry::can_be_dropped ( ) const

Check if service can be dropped.

◆ get_service_config()

const datatools::properties& datatools::service_entry::get_service_config ( ) const

Return a reference to the non mutable service configuration.

◆ get_service_handle()

const service_handle_type& datatools::service_entry::get_service_handle ( ) const

Return a handle to the non mutable service.

◆ get_service_id()

const std::string& datatools::service_entry::get_service_id ( ) const

Return the service identifier.

◆ get_service_manager()

const service_manager& datatools::service_entry::get_service_manager ( ) const

Return a reference to the service manager.

◆ get_service_name()

const std::string& datatools::service_entry::get_service_name ( ) const

Return the service name.

◆ get_service_status()

uint32_t datatools::service_entry::get_service_status ( ) const

Return the service status.

◆ grab_service_config()

datatools::properties& datatools::service_entry::grab_service_config ( )

Return a reference to the mutable service configuration.

◆ grab_service_handle()

service_handle_type& datatools::service_entry::grab_service_handle ( )

Return a handle to the mutable service.

◆ grab_service_manager()

service_manager& datatools::service_entry::grab_service_manager ( )

Return a mutable reference to the service manager.

◆ has_master()

bool datatools::service_entry::has_master ( const std::string &  name_) const

Check if the service object has master service with given name.

◆ has_service_manager()

bool datatools::service_entry::has_service_manager ( ) const

Check if service manager is available.

◆ is_created()

bool datatools::service_entry::is_created ( ) const

Check if the service object is instantiated.

◆ is_initialized()

bool datatools::service_entry::is_initialized ( ) const

Check if the service object is initialized.

◆ reset_service_status()

void datatools::service_entry::reset_service_status ( uint32_t  )

Reset the service status.

◆ set_service_config()

void datatools::service_entry::set_service_config ( const datatools::properties )

Set the service configuration.

◆ set_service_id()

void datatools::service_entry::set_service_id ( const std::string &  )

Set the service identifier.

◆ set_service_manager()

void datatools::service_entry::set_service_manager ( service_manager smgr_)

Set the service manager.

◆ set_service_name()

void datatools::service_entry::set_service_name ( const std::string &  )

Set the service name.

◆ tree_dump()

virtual void datatools::service_entry::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::i_tree_dumpable.

◆ update_service_status()

void datatools::service_entry::update_service_status ( uint32_t  )

Update the service status.

Member Data Documentation

◆ service_masters

service_dependency_dict_type datatools::service_entry::service_masters

The list of services the service depends on (by names)


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