14#include "arcane/utils/List.h"
16#include "arcane/core/IServiceInfo.h"
18#include "arcane/core/ServiceInstance.h"
94 Int32 v = std::atomic_fetch_add(&m_nb_ref, -1);
102 void destroyInstance()
104 m_true_instance.reset();
112 void addInstance(ServiceInstanceRef instance)
override
114 m_instances.add(instance);
119 IServiceInfo* m_service_info;
120 List<ServiceInstanceRef> m_instances;
121 ServiceInstanceRef m_true_instance;
122 std::atomic<Int32> m_nb_ref = 0;
135 x->setTrueInstance(si);
154 Int32 v = std::atomic_fetch_add(&m_nb_ref, -1);
This file contains the various service factories and macros for registering services.
Interface for service or module information.
void removeReference() override
Remove a reference.
void addReference() override
Add a reference.
Singleton service instances.
ServiceInstanceCollection interfaceInstances() override
List of instances of interfaces implemented by the singleton.
void removeReference() override
Removes a reference.
void addReference() override
Adds a reference.
Ref< ISingletonServiceInstance > createSingletonServiceInstance(const ServiceBuildInfoBase &sbib) override
Creates a singleton service instance.
IServiceInfo * serviceInfo() const override
Returns the IServiceInfo associated with this factory.
Reference to an instance.
Information for creating a service.
Reference to a service instance.
Internal types of Arcane.
auto makeRef(InstanceType *t) -> Ref< InstanceType >
Creates a reference on a pointer.
Collection< ServiceInstanceRef > ServiceInstanceCollection
Collection of service instances.
std::int32_t Int32
Signed integer type of 32 bits.