Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
ServiceB Class Reference
Inheritance diagram for ServiceB:
Inheritance graph
Collaboration diagram for ServiceB:
Collaboration graph

Public Member Functions

 ServiceB (std::shared_ptr< ServiceA > a)
 
std::string get_name () const override
 
std::shared_ptr< ServiceAget_dependency () const
 
- Public Member Functions inherited from IService
virtual ~IService ()=default
 

Private Attributes

std::shared_ptr< ServiceAservice_a_
 

Detailed Description

Definition at line 62 of file test_di_container.cpp.

Constructor & Destructor Documentation

◆ ServiceB()

ServiceB::ServiceB ( std::shared_ptr< ServiceA > a)
inlineexplicit

Definition at line 67 of file test_di_container.cpp.

67: service_a_(std::move(a)) {}
std::shared_ptr< ServiceA > service_a_

Member Function Documentation

◆ get_dependency()

std::shared_ptr< ServiceA > ServiceB::get_dependency ( ) const
inline

Definition at line 74 of file test_di_container.cpp.

74{ return service_a_; }

References service_a_.

◆ get_name()

std::string ServiceB::get_name ( ) const
inlineoverridevirtual

Implements IService.

Definition at line 69 of file test_di_container.cpp.

70 {
71 return "ServiceB_with_" + service_a_->get_name();
72 }
std::string get_name() const override

References ServiceA::get_name(), and service_a_.

Here is the call graph for this function:

Member Data Documentation

◆ service_a_

std::shared_ptr<ServiceA> ServiceB::service_a_
private

Definition at line 64 of file test_di_container.cpp.

Referenced by get_dependency(), and get_name().


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