blob: d8ebb1fa9b108dd37a5de0ad228e57da57a295b2 (
plain)
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
46
47
48
49
50
51
52
53
|
/*
* Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef STANDALONE_SERVICE_CONTEXT_H
#define STANDALONE_SERVICE_CONTEXT_H
#include <service_locator.h>
#include <rpc/common/endpoint/call_ep.h>
#include <rpc/direct/direct_caller.h>
#include <string>
class standalone_service_context
{
public:
standalone_service_context(const char *sn);
virtual ~standalone_service_context();
void init();
void deinit();
rpc_session_handle open(struct rpc_caller **caller);
void close(rpc_session_handle session_handle);
const std::string &get_service_name() const;
struct service_context *get_service_context();
protected:
void set_call_ep(call_ep *ep);
virtual void do_init() {}
virtual void do_deinit() {}
private:
struct rpc_session
{
rpc_session(struct call_ep *call_ep);
~rpc_session();
struct direct_caller m_direct_caller;
struct rpc_caller *m_rpc_caller;
};
std::string m_sn;
int m_ref_count;
struct service_context m_service_context;
struct call_ep *m_call_ep;
};
#endif /* STANDALONE_SERVICE_CONTEXT_H */
|