Commit Graph

6 Commits

Author SHA1 Message Date
Tomasz Grabiec
6c89e3d2ea serializer: Fix wrong size_type being serialized into the placeholder 2016-02-26 12:26:13 +01:00
Tomasz Grabiec
4ab0ca07f1 idl-compiler: Catch un-closed frame errors sooner
By initilizing them to 0 we can catch unclosed frames at
deserialization time. It's better than leaving frame size undefined,
which may cause errors much later in deserialization process and thus
would make it harder to identifiy the real cause.
2016-02-26 12:26:13 +01:00
Tomasz Grabiec
85fb4eba32 Add missing includes 2016-02-26 12:26:13 +01:00
Amnon Heiman
ea97e07ed7 serialization_visitors: Adding vector_position struct
While serialization vector it is sometimes required to rollback some of
the serialized elements.

vector_position is the equivalent to the bytes_ostream position struct.
It holds information about the current position in a serialized vector,
the position in the bufffer and the current number of elements
serialized.

It will allow to rollback to the current point.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1456041750-1505-2-git-send-email-amnon@scylladb.com>
2016-02-23 17:49:51 +01:00
Amnon Heiman
33d5c95b90 serialization_visitors: Add skip template
The skip template function is used when skipping data types.
By default is uses a deserializer to calculate the size.

A specific implementation save unneeded deserialization. For fix sized
object the skip function would become an expression allowing the
compiler to drop the function altogether.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2016-02-17 18:42:09 +02:00
Amnon Heiman
64c097422d Adding the serialization_visitors.hh file
The serialization_visitors.hh contains helper classes for the readers and writers
visitors class.

place_holder is a wrapper around bytes_stream place holder.
frame is used to store size in bytes.
empty_frame is used with final object (that do not store their size)
from the code that uses it, it looks the same, but in practice it does
not store any data.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2016-02-17 18:42:08 +02:00