|
DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
|
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects. More...
#include <IServiceProvider.h>
Public Member Functions | |
| virtual | ~IServiceProvider ()=default |
| Virtual destructor for polymorphic interface cleanup. | |
| template<typename T> | |
| SmartPointer< T > | GetRequiredService () |
| Gets service of type T, throwing InvalidOperationException if not found. | |
| template<typename T> | |
| SmartPointer< T > | GetService () |
| Gets the service object of the specified generic type T. | |
| virtual SmartPointer< Object > | GetService (const std::type_index &serviceType)=0 |
| Gets the service object of the specified type. | |
| Public Member Functions inherited from DotNetDupe::System::Object | |
| virtual | ~Object ()=default |
| Virtual destructor ensuring polymorphic cleanup. | |
| virtual bool | Equals (const Object &obj) const |
| Determines whether the specified Object is equal to the current Object. | |
| virtual int | GetHashCode () const |
| Serves as the default hash function. | |
| bool | operator== (const Object &obj) const |
| Determines reference equality between two objects. | |
| char * | ToStringA () const |
| Returns narrow-character string representation. | |
| wchar_t * | ToStringW () const |
| Returns wide-character string representation. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from DotNetDupe::System::Object | |
| static bool | Equals (const Object &obj1, const Object &obj2) |
| Static helper determining whether two object instances are equal. | |
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
Modeled after System.IServiceProvider in .NET Base Class Library (ECMA-335). Serves as the base resolution contract implemented by IoC containers across DotNetDupe. [ECMA-335]
Definition at line 20 of file IServiceProvider.h.
|
virtualdefault |
Virtual destructor for polymorphic interface cleanup.
|
inline |
Gets service of type T, throwing InvalidOperationException if not found.
| T | The type of service object to get. |
| InvalidOperationException | Thrown if the service cannot be resolved. |
Definition at line 47 of file IServiceProvider.h.
References DotNetDupe::System::InvalidOperationException::InvalidOperationException(), GetService(), and DotNetDupe::System::SmartPointer< T >::IsNull().
|
inline |
Gets the service object of the specified generic type T.
| T | The type of service object to get. |
Definition at line 34 of file IServiceProvider.h.
References DotNetDupe::System::SmartPointer< T >::SmartPointer, DotNetDupe::System::DynamicCast(), GetService(), and DotNetDupe::System::SmartPointer< T >::IsNull().
|
pure virtual |
Gets the service object of the specified type.
| serviceType | An object that specifies the type of service object to get. |
Implemented in DotNetDupe::Extensions::DependencyInjection::ServiceProvider.
Referenced by GetRequiredService(), and GetService().