Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
service_container.h File Reference

Implementation of the service container for dependency injection. More...

#include "service_container_interface.h"
#include "../interfaces/registry_audit_log.h"
#include <atomic>
#include <mutex>
#include <shared_mutex>
#include <unordered_map>
#include <unordered_set>
Include dependency graph for service_container.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  kcenon::common::di::service_container
 Concrete implementation of IServiceContainer. More...
 
struct  kcenon::common::di::service_container::service_entry
 Internal service registration entry. More...
 
class  kcenon::common::di::service_scope
 Scoped service container implementation. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::common
 Core interfaces.
 
namespace  kcenon::common::di
 

Detailed Description

Implementation of the service container for dependency injection.

This header provides the concrete implementation of IServiceContainer, enabling type-safe dependency injection with configurable lifetimes.

Thread Safety:

  • service_container is thread-safe for concurrent registration and resolution.
  • Uses std::shared_mutex for read/write locking.
  • Singleton instantiation uses double-checked locking pattern.
  • Circular dependency detection uses thread-local resolution stack.
See also
TICKET-102 for implementation requirements.
service_container_interface.h for the interface definition.

Definition in file service_container.h.