[Yunq] Accept a message view on message parsing.
This commit is contained in:
parent
75d84a0fa5
commit
0135d8d844
19 changed files with 94 additions and 107 deletions
|
|
@ -19,8 +19,7 @@ struct ExtPointer {
|
|||
} // namespace
|
||||
|
||||
{%- for message in messages %}
|
||||
glcr::Status {{message.name}}::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_t offset) {
|
||||
yunq::MessageView message(bytes, offset);
|
||||
glcr::Status {{message.name}}::ParseFromBytes(const yunq::MessageView& message) {
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
|
||||
{%- for field in message.fields %}
|
||||
|
|
@ -37,8 +36,7 @@ glcr::Status {{message.name}}::ParseFromBytes(const glcr::ByteBuffer& bytes, uin
|
|||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
glcr::Status {{message.name}}::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_t offset, const glcr::CapBuffer& caps) {
|
||||
yunq::MessageView message(bytes, offset);
|
||||
glcr::Status {{message.name}}::ParseFromBytes(const yunq::MessageView& message, const glcr::CapBuffer& caps) {
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
|
||||
{%- for field in message.fields %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue