[Yunq] Return status in server code.
This commit is contained in:
parent
3eba0bd9d8
commit
700f3f94cb
20 changed files with 166 additions and 178 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <glacier/status/error_or.h>
|
||||
#include <glacier/status/status.h>
|
||||
#include <mammoth/proc/thread.h>
|
||||
#include <ztypes.h>
|
||||
|
||||
|
|
@ -28,11 +29,11 @@ class {{interface.name}}ServerBase {
|
|||
|
||||
{% for method in interface.methods %}
|
||||
{% if method.request == None %}
|
||||
[[nodiscard]] virtual glcr::ErrorCode Handle{{method.name}}({{method.response}}&) = 0;
|
||||
[[nodiscard]] virtual glcr::Status Handle{{method.name}}({{method.response}}&) = 0;
|
||||
{% elif method.response == None %}
|
||||
[[nodiscard]] virtual glcr::ErrorCode Handle{{method.name}}(const {{method.request}}&) = 0;
|
||||
[[nodiscard]] virtual glcr::Status Handle{{method.name}}(const {{method.request}}&) = 0;
|
||||
{% else %}
|
||||
[[nodiscard]] virtual glcr::ErrorCode Handle{{method.name}}(const {{method.request}}&, {{method.response}}&) = 0;
|
||||
[[nodiscard]] virtual glcr::Status Handle{{method.name}}(const {{method.request}}&, {{method.response}}&) = 0;
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
|
@ -42,9 +43,9 @@ class {{interface.name}}ServerBase {
|
|||
friend void {{interface.name}}ServerBaseThreadBootstrap(void*);
|
||||
void ServerThread();
|
||||
|
||||
[[nodiscard]] glcr::ErrorCode HandleRequest(const glcr::ByteBuffer& request, const glcr::CapBuffer& req_caps,
|
||||
glcr::ByteBuffer& response, uint64_t& resp_length,
|
||||
glcr::CapBuffer& resp_caps);
|
||||
[[nodiscard]] glcr::Status HandleRequest(const glcr::ByteBuffer& request, const glcr::CapBuffer& req_caps,
|
||||
glcr::ByteBuffer& response, uint64_t& resp_length,
|
||||
glcr::CapBuffer& resp_caps);
|
||||
};
|
||||
|
||||
{% endfor %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue