You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(sdk): add ScalarRecord/ObjectRecord for parser-controlled timestamps (#92)
* feat(sdk): add ScalarRecord/ObjectRecord for parser-controlled timestamps
Introduce ScalarRecord {optional<Timestamp> ts, vector<NamedFieldValue>}
and ObjectRecord {optional<Timestamp> ts, BuiltinObject} as the new
return types of the SchemaHandler parse_scalars / parse_object
callables.
When ts is nullopt the host uses the message receive time as before;
when set, the parser-provided timestamp is used instead — restoring
the ability to align rows with timestamps embedded in the payload
(e.g. ROS Header.stamp, JSON "timestamp" field, sensor capture time).
The default parse() now iterates the returned records and respects each
record's timestamp, also enabling multi-row output from a single payload
(useful for batch messages such as JSON arrays).
* refactor(sdk): drop multi-row vector on parse_scalars to keep one alloc per call
Review feedback: returning std::vector<ScalarRecord> meant every call
ended up doing two heap allocations in the common case (outer vector +
the fields vector inside the only record), even for single-row decoding
on a hot streaming path.
The parser-controlled timestamp was the actual ask from the client;
multi-row batch was added speculatively for JSON arrays and is not a
shipping requirement. Drop the outer vector and return a single
ScalarRecord; one allocation total, same shape as the pre-change API
plus the optional<Timestamp>.
Parsers that need to emit multiple rows per payload can stage a batch
API later if/when a concrete use case shows up — the SchemaHandler
shape leaves room for that without breaking ScalarRecord.
* chore: bump conan package version to 0.3.0
* chore: bump plugin ABI to v5
---------
Co-authored-by: Davide Faconti <dfaconti@aurynrobotics.com>
0 commit comments