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