chromium/services/service_manager/service_instance_registry.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SERVICES_SERVICE_MANAGER_SERVICE_INSTANCE_REGISTRY_H_
#define SERVICES_SERVICE_MANAGER_SERVICE_INSTANCE_REGISTRY_H_

#include <map>
#include <optional>
#include <string>

#include "base/memory/raw_ptr.h"
#include "base/token.h"
#include "services/service_manager/public/cpp/identity.h"
#include "services/service_manager/public/cpp/service_filter.h"

namespace service_manager {

class ServiceInstance;

// A container of (unowned) pointers to ServiceInstance objects, indexed by each
// instance's Identity according to the service's specified instance sharing
// policy.
//
// For example, some services may declare in their manifest that they're
// singletons, in which case only one instance of that service is ever indexed
// at a time.
//
// Other services may declare that they're shared across multiple instance
// groups, but can still have multiple instances identified by unique instance
// IDs.
//
// These different sharing configurations affect how a ServiceFilter is resolved
// to a specific instance by the ServiceManager, and the logic which determines
// that resolution process is encapsulated within ServiceInstanceRegistry.
class ServiceInstanceRegistry {};

}  // namespace service_manager

#endif  // SERVICES_SERVICE_MANAGER_SERVICE_INSTANCE_REGISTRY_H_