2023-06-21 23:42:21 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <glacier/status/error.h>
|
|
|
|
|
|
|
|
#include "include/ztypes.h"
|
|
|
|
#include "lib/message_queue.h"
|
|
|
|
#include "object/kernel_object.h"
|
|
|
|
|
|
|
|
class IpcObject : public KernelObject {
|
|
|
|
public:
|
|
|
|
IpcObject(){};
|
|
|
|
virtual ~IpcObject() {}
|
|
|
|
|
2023-11-03 00:37:53 -07:00
|
|
|
virtual glcr::ErrorCode Send(IpcMessage&& message) final;
|
2023-11-02 23:31:08 -07:00
|
|
|
|
2023-11-03 00:12:28 -07:00
|
|
|
virtual glcr::ErrorOr<IpcMessage> Recv(uint64_t data_buf_size,
|
|
|
|
uint64_t cap_buf_size) final;
|
2023-06-21 23:42:21 -07:00
|
|
|
|
2023-06-21 23:57:23 -07:00
|
|
|
bool HasMessages() { return !GetRecvMessageQueue().empty(); }
|
2023-06-21 23:42:21 -07:00
|
|
|
|
|
|
|
virtual MessageQueue& GetSendMessageQueue() = 0;
|
|
|
|
virtual MessageQueue& GetRecvMessageQueue() = 0;
|
|
|
|
};
|