2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
2022-03-03 11:37:49 -07:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2019-08-03 15:29:40 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2023-12-16 17:49:34 +03:30
|
|
|
#include <AK/ByteString.h>
|
2019-08-03 19:21:15 +02:00
|
|
|
#include <AK/OwnPtr.h>
|
2024-01-02 20:18:48 -05:00
|
|
|
#include <LibIPC/Forward.h>
|
2019-08-03 19:21:15 +02:00
|
|
|
|
|
|
|
|
namespace AK {
|
2025-05-13 07:06:33 -04:00
|
|
|
|
2019-08-03 19:21:15 +02:00
|
|
|
class BufferStream;
|
2025-05-13 07:06:33 -04:00
|
|
|
|
2019-08-03 19:21:15 +02:00
|
|
|
}
|
|
|
|
|
|
2020-02-05 19:57:18 +01:00
|
|
|
namespace IPC {
|
|
|
|
|
|
2021-05-03 08:46:40 +02:00
|
|
|
class Stub {
|
2019-08-03 15:29:40 +02:00
|
|
|
public:
|
2022-03-03 11:37:49 -07:00
|
|
|
virtual ~Stub() = default;
|
2019-08-03 15:29:40 +02:00
|
|
|
|
2021-04-25 13:19:53 +02:00
|
|
|
virtual u32 magic() const = 0;
|
2023-12-16 17:49:34 +03:30
|
|
|
virtual ByteString name() const = 0;
|
2025-03-08 12:22:39 -05:00
|
|
|
virtual ErrorOr<OwnPtr<MessageBuffer>> handle(NonnullOwnPtr<Message>) = 0;
|
2019-08-03 15:29:40 +02:00
|
|
|
|
|
|
|
|
protected:
|
2022-03-03 11:37:49 -07:00
|
|
|
Stub() = default;
|
2019-08-03 15:29:40 +02:00
|
|
|
|
|
|
|
|
private:
|
2023-12-16 17:49:34 +03:30
|
|
|
ByteString m_name;
|
2019-08-03 15:29:40 +02:00
|
|
|
};
|
2020-02-05 19:57:18 +01:00
|
|
|
|
|
|
|
|
}
|