diff --git a/src/dataencode.cpp b/src/dataencode.cpp index bb90e4a..14f6b86 100644 --- a/src/dataencode.cpp +++ b/src/dataencode.cpp @@ -730,7 +730,7 @@ void from_wire_valid(Buffer& buf, TypeStore& ctxt, Value& val) } } -void from_wire_type_value(Buffer& buf, TypeStore& ctxt, Value& val) +void from_wire_type(Buffer& buf, TypeStore& ctxt, Value& val) { auto descs(std::make_shared>()); @@ -743,13 +743,19 @@ void from_wire_type_value(Buffer& buf, TypeStore& ctxt, Value& val) std::shared_ptr stype(descs, descs->data()); // alias val = Value::Helper::build(stype); - from_wire_full(buf, ctxt, val); - } else { val = Value(); } } +void from_wire_type_value(Buffer& buf, TypeStore& ctxt, Value& val) +{ + from_wire_type(buf, ctxt, val); + + if(buf.good() && val) + from_wire_full(buf, ctxt, val); +} + }} // namespace pvxs::impl #endif // DATAENCODE_H diff --git a/src/dataimpl.h b/src/dataimpl.h index 35c9438..a6b5f33 100644 --- a/src/dataimpl.h +++ b/src/dataimpl.h @@ -157,6 +157,10 @@ void to_wire_valid(Buffer& buf, const Value& val, const BitMask* mask=nullptr); //! deserialize type description PVXS_API +void from_wire_type(Buffer& buf, TypeStore& ctxt, Value& val); + +//! deserialize full Value +PVXS_API void from_wire_full(Buffer& buf, TypeStore& ctxt, Value& val); //! deserialize BitMask and partial Value