forked from eclipse-score/communication
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfind_service_handler.h
More file actions
45 lines (37 loc) · 1.66 KB
/
find_service_handler.h
File metadata and controls
45 lines (37 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/********************************************************************************
* Copyright (c) 2025 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_COM_IMPL_FIND_SERVICE_HANDLER_H
#define SCORE_MW_COM_IMPL_FIND_SERVICE_HANDLER_H
#include "score/mw/com/impl/find_service_handle.h"
#include <score/callback.hpp>
#include <vector>
namespace score::mw::com::impl
{
/// \api
/// \brief The container holds a list of service handles and is used as a return value of the FindService methods.
/// \requirement SWS_CM_00304
template <typename T>
using ServiceHandleContainer = std::vector<T>;
/// \api
/// \brief A function wrapper for the handler function that gets called by the Communication Management software in case
/// the service availability changes.
///
/// \details It takes as input parameter a handle container containing handles for all matching service instances and a
/// FindServiceHandle which can be used to invoke StopFindService (see [SWS_CM_00125]) from within the
/// FindServiceHandler.
///
/// \requirement SWS_CM_00383
template <typename T>
using FindServiceHandler = score::cpp::callback<void(ServiceHandleContainer<T>, FindServiceHandle)>;
} // namespace score::mw::com::impl
#endif // SCORE_MW_COM_IMPL_FIND_SERVICE_HANDLER_H