add from_wire_type()
This commit is contained in:
+9
-3
@@ -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<std::vector<FieldDesc>>());
|
||||
|
||||
@@ -743,13 +743,19 @@ void from_wire_type_value(Buffer& buf, TypeStore& ctxt, Value& val)
|
||||
std::shared_ptr<const FieldDesc> 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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user