mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
IPCCompiler: More work towards AudioServer bringup
- Add IEndpoint::handle(IMessage), a big switch table on message type. handle() will return a response message for synchronous messages, and return nullptr otherwise. - Use i32 instead of int for everything - Make IMessage::encode() const - Make IEndpoint::decode_message() static, this allows template code to decode messages without an endpoint instance on hand.
This commit is contained in:
parent
18aeda2e0d
commit
3519b6c201
3 changed files with 40 additions and 8 deletions
|
@ -1,12 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
|
||||
namespace AK {
|
||||
class BufferStream;
|
||||
}
|
||||
|
||||
class IMessage;
|
||||
|
||||
class IEndpoint {
|
||||
public:
|
||||
virtual ~IEndpoint();
|
||||
|
||||
virtual String name() const = 0;
|
||||
virtual OwnPtr<IMessage> handle(const IMessage&) = 0;
|
||||
|
||||
protected:
|
||||
IEndpoint();
|
||||
|
|
|
@ -9,7 +9,7 @@ public:
|
|||
|
||||
virtual int id() const = 0;
|
||||
virtual String name() const = 0;
|
||||
virtual ByteBuffer encode() = 0;
|
||||
virtual ByteBuffer encode() const = 0;
|
||||
|
||||
protected:
|
||||
IMessage();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue