mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +00:00

- 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.
16 lines
261 B
C++
16 lines
261 B
C++
#pragma once
|
|
|
|
#include <AK/AKString.h>
|
|
#include <AK/ByteBuffer.h>
|
|
|
|
class IMessage {
|
|
public:
|
|
virtual ~IMessage();
|
|
|
|
virtual int id() const = 0;
|
|
virtual String name() const = 0;
|
|
virtual ByteBuffer encode() const = 0;
|
|
|
|
protected:
|
|
IMessage();
|
|
};
|