master
Claudius Holeksa 2021-12-29 19:50:32 +01:00
commit 8895f5e68f
2 changed files with 7 additions and 5 deletions

View File

@ -106,7 +106,7 @@ public:
SchemaIsArray< SchemaIsArray<
typename MessageParameterPackType<i, V...>::Type>::Value, typename MessageParameterPackType<i, V...>::Type>::Value,
typename Container::template ElementType<i>::Builder>::type typename Container::template ElementType<i>::Builder>::type
init(size_t size) { init(size_t size = 0) {
auto array_builder = auto array_builder =
typename Container::template ElementType<i>::Builder{ typename Container::template ElementType<i>::Builder{
message.container.template get<i>(), size}; message.container.template get<i>(), size};
@ -234,7 +234,7 @@ public:
SchemaIsArray< SchemaIsArray<
typename MessageParameterPackType<i, V...>::Type>::Value, typename MessageParameterPackType<i, V...>::Type>::Value,
typename Container::template ElementType<i>::Builder>::type typename Container::template ElementType<i>::Builder>::type
init(size_t size) { init(size_t size = 0) {
return typename Container::template ElementType<i>::Builder{ return typename Container::template ElementType<i>::Builder{
message.container.template get<i>(), size}; message.container.template get<i>(), size};
} }
@ -332,6 +332,8 @@ public:
} }
size_t size() const { return message.container.size(); } size_t size() const { return message.container.size(); }
void resize(size_t size) { message.container.resize(size); }
}; };
class Reader { class Reader {
@ -394,7 +396,7 @@ public:
SchemaIsArray< SchemaIsArray<
typename MessageParameterPackType<i, T...>::Type>::Value, typename MessageParameterPackType<i, T...>::Type>::Value,
typename Container::template ElementType<i>::Builder>::type typename Container::template ElementType<i>::Builder>::type
init(size_t size) { init(size_t size = 0) {
return typename Container::template ElementType<i>::Builder{ return typename Container::template ElementType<i>::Builder{
message.container.template get<i>(), size}; message.container.template get<i>(), size};
} }

View File

@ -4,8 +4,6 @@
#include "message.h" #include "message.h"
#include "stream_endian.h" #include "stream_endian.h"
#include <iostream>
namespace saw { namespace saw {
/// @todo replace types with these /// @todo replace types with these
/* /*
@ -493,6 +491,8 @@ struct ProtoKelDecodeImpl<Message<schema::Array<T>, Container>> {
} }
} }
data.resize(array_length);
for (size_t i = 0; i < array_length; ++i) { for (size_t i = 0; i < array_length; ++i) {
Error error = Error error =
ProtoKelDecodeImpl<typename Container::ElementType>::decode( ProtoKelDecodeImpl<typename Container::ElementType>::decode(