from_wire_type_value

This commit is contained in:
Michael Davidsaver
2019-12-14 16:37:04 -08:00
parent ca662bf6cc
commit 9af9f028eb
2 changed files with 24 additions and 0 deletions
+22
View File
@@ -697,6 +697,28 @@ void from_wire_valid(Buffer& buf, TypeStore& ctxt, Value& val)
}
}
void from_wire_type_value(Buffer& buf, TypeStore& ctxt, Value& val)
{
std::shared_ptr<std::vector<FieldDesc>> descs(new std::vector<FieldDesc>);
TypeDeserContext dc{*descs, ctxt};
from_wire(buf, dc);
if(!buf.good())
return;
if(!descs->empty()) {
FieldDesc_calculate_offset(descs->data());
std::shared_ptr<const FieldDesc> stype(descs, descs->data()); // alias
val = Value::Helper::build(stype);
from_wire_full(buf, ctxt, val);
} else {
val = Value();
}
}
}} // namespace pvxs::impl
#endif // DATAENCODE_H