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
-**Namespaces:** flat `PJ`; `PJ::encoding` and `PJ::arrow_import` for internals.
120
+
-**Errors:**`PJ::Expected<T>` for fallible ops, `PJ_ASSERT(cond, msg)` for invariants.
121
+
-**Warnings:**`-Wall -Wextra -Werror` on all targets.
109
122
110
123
## Instructions Glossary
111
124
112
-
-**"Read all documentation"** means: find and read every `.md` file in the entire project tree (all subdirectories). Use `find . -name "*.md"` or equivalent. This includes docs in `docs/`, `pj_datastore/docs/`, `pj_plugins/docs/`, and any other location.
113
-
114
-
-**"Update the documentation"** means: based on what you learned during this session, correct any documentation that is outdated or inaccurate, and clarify any ambiguity that caused confusion or errors. If a doc says one thing but the code does another, fix the doc to match reality. If missing information led to a bug, add it.
115
-
116
-
-**"Check documentation"** means: review the docs listed above that are related to the changed module or API.
117
-
Confirm they still describe the current intent and behavior. If not, update them or ask the user before
118
-
committing.
119
-
120
-
## Coding Conventions
121
-
122
-
-**Formatting:** Google style via `.clang-format` — 2-space indent, 120-char limit
# pj_base — SDK vocabulary, builtin object schemas, and the C plugin ABI
2
+
3
+
pj_base is the **Level 0** foundation and the **SDK boundary** for plugin authors. It owns: the zero-dependency vocabulary types (`Timestamp`, `DatasetId`, `Range`, `Expected<T>`, `Span`, `TypeTree`); the canonical *builtin object* schemas (`sdk::Image`, `PointCloud`, `DepthImage`, `OccupancyGrid`, `FrameTransforms`, … — 15 types) **and 14 of their wire codecs** (RobotDescription has none); and the **C ABI** primitives every plugin family speaks (`plugin_data_api.h` + the service registry) plus the C-ABI protocol headers for **three** families — `data_source_protocol.h`, `message_parser_protocol.h`, `toolbox_protocol.h`. The **Dialog** protocol header is the exception: it lives in `pj_plugins/dialog_protocol/`, not here. It also ships the C++ SDK base classes for DataSource and Toolbox; the MessageParser and Dialog base classes live in `pj_plugins`. Builds as a STATIC lib with **zero public deps** — `fast_float` is a `BUILD_INTERFACE` private impl detail of `parseNumber`. Must NOT depend on `pj_datastore`, `pj_plugins`, Qt, or any Conan runtime lib. This is a read-only submodule subtree: change it only when explicitly working in `plotjuggler_core`.
-`include/pj_base/builtin/` — the 15 builtin object struct headers (`*.hpp`; 16 enum values in `BuiltinObjectType`, value 2 reserved) + their 14 wire codecs (`*_codec.hpp`; RobotDescription has none) + the `BuiltinObject` (`std::any`) type-erased holder.
8
+
-`include/pj_base/sdk/` — C++ SDK over the ABI: DataSource + Toolbox `*_plugin_base.hpp`, `service_registry.hpp`/`service_traits.hpp`, host views, Arrow RAII holders, `testing/`.
9
+
-`include/pj_base/*_protocol.h`, `plugin_data_api.h`, `builtin_object_abi.h`, `plugin_abi_export.hpp` — the stable C-ABI surface for DataSource/MessageParser/Toolbox (the Dialog protocol header lives in `pj_plugins/dialog_protocol/`).
10
+
-`proto/pj/` — canonical `.proto` wire contracts for the builtin types (see its README).
11
+
-`src/`, `tests/` — codec/parse impls and gtests.
12
+
-`abi/baseline.abi` — golden libabigail dump; the ABI-stability regression baseline.
13
+
14
+
## Gotchas
15
+
- ABI numbering is **frozen**: `BuiltinObjectType` (builtin_object.hpp) and `PJ_builtin_object_type_t` (builtin_object_abi.h) share stable numeric values — never renumber; type 2 is permanently reserved. Append-only.
16
+
- Every vtable slot is `PJ_NOEXCEPT`; a throw across the ABI boundary calls `std::terminate`. See the header block in `plugin_data_api.h`.
17
+
-`BuiltinObject` is `std::any`, deliberately not `std::variant`, for forward-compat — recover via `std::any_cast<T>` / `sdk::typeOf`. See `builtin/builtin_object.hpp`.
18
+
- ABI/struct-layout or signature changes require a Conan **MINOR** bump and a refreshed `abi/baseline.abi`; tail-appended slots are a PATCH (see submodule CLAUDE.md → Release Versioning).
19
+
20
+
## Read deeper
21
+
| For | Read |
22
+
|---|---|
23
+
| Builtin type design, serialization families, type-erasure rules |`../docs/builtin_type.md`|
24
+
| ImageAnnotations canonical wire format |`../docs/image_annotations_format.md`|
25
+
| C++ style / error-handling (`Expected`, `PJ_ASSERT`) |`../docs/cpp_design_recommendations.md`|
26
+
| Per-family ABI driving order + thread tags |`include/pj_base/data_source_protocol.h`, `message_parser_protocol.h`, `toolbox_protocol.h`|
27
+
| Writing a DataSource plugin |`include/pj_base/sdk/data_source_patterns.hpp` (start here) |
0 commit comments