/src/serenity/Userland/Libraries/LibIPC/Stub.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> |
3 | | * Copyright (c) 2022, the SerenityOS developers. |
4 | | * |
5 | | * SPDX-License-Identifier: BSD-2-Clause |
6 | | */ |
7 | | |
8 | | #pragma once |
9 | | |
10 | | #include <AK/ByteString.h> |
11 | | #include <AK/OwnPtr.h> |
12 | | #include <LibIPC/Forward.h> |
13 | | |
14 | | namespace AK { |
15 | | class BufferStream; |
16 | | } |
17 | | |
18 | | namespace IPC { |
19 | | |
20 | | class Stub { |
21 | | public: |
22 | 0 | virtual ~Stub() = default; |
23 | | |
24 | | virtual u32 magic() const = 0; |
25 | | virtual ByteString name() const = 0; |
26 | | virtual ErrorOr<OwnPtr<MessageBuffer>> handle(Message const&) = 0; |
27 | | |
28 | | protected: |
29 | 0 | Stub() = default; |
30 | | |
31 | | private: |
32 | | ByteString m_name; |
33 | | }; |
34 | | |
35 | | } |