Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions quality/visibility_guard/public_targets.golden
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@
//score/mw/service:factory
//score/mw/service:provided_service
//score/mw/service:provided_service_container
//score/mw/service:proxy_data
//score/mw/service:proxy_future
//score/mw/service:service
10 changes: 10 additions & 0 deletions score/mw/service/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ cc_library(
":service",
],
)

cc_library(
name = "proxy_data",
hdrs = ["proxy_data.h"],
features = COMPILER_WARNING_FEATURES,
visibility = ["//visibility:public"],
deps = [
":service",
],
)
12 changes: 10 additions & 2 deletions score/mw/service/provided_service_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ class ProvidedServices final : public ProvidedServicesBase
template <typename ServiceType, typename... Args>
ProvidedServices& Add(Args&&... args) &
{
++count_;
return *this;
}

template <typename ServiceType, typename... Args>
ProvidedServices&& Add(Args&&... args) &&
{
++count_;
return std::move(*this);
}

Expand Down Expand Up @@ -168,7 +170,7 @@ class ProvidedServices final : public ProvidedServicesBase

std::size_t Count() const noexcept override
{
return 0;
return count_;
}

/// @brief Start all contained valid service instances
Expand All @@ -178,7 +180,13 @@ class ProvidedServices final : public ProvidedServicesBase
void StopAll() override {}

/// @brief Swap the content of this object with another one
void Swap(ProvidedServices& other) noexcept {}
void Swap(ProvidedServices& other) noexcept
{
std::swap(count_, other.count_);
}

private:
std::size_t count_{0U};
};

class ProvidedServiceContainer
Expand Down
35 changes: 35 additions & 0 deletions score/mw/service/proxy_data.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// *******************************************************************************
// Copyright (c) 2026 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0
//
// SPDX-License-Identifier: Apache-2.0
// *******************************************************************************

#ifndef SCORE_MW_SERVICE_PROXY_DATA_H
#define SCORE_MW_SERVICE_PROXY_DATA_H

#include "score/mw/service/proxy_needs.h"

namespace score
{
namespace mw
{
namespace service
{

/// @brief Stub alias for OptionalProxyData — wraps an optional proxy instance.
/// @tparam T The proxy interface type
template <typename T>
using OptionalProxyData = Optional<T>;

} // namespace service
} // namespace mw
} // namespace score

#endif // SCORE_MW_SERVICE_PROXY_DATA_H
Loading