G: CemObjectStore (E120 Common Equipment Model)

Hierarchical object tree for equipment self-description.  Each object
carries a CemObjectType (Equipment / Subsystem / IODevice / Module /
MaterialLocation / Other), an optional parent_objid, and a flat
attribute map keyed by name (the wire shape S14F1 / F3 returns).

Operations covered:
  add(CemObject)        - dedup'd, validates parent exists
  get / has             - lookup by objid
  get_attr / set_attr   - E14 GetAttr / SetAttr semantics
  children(parent)      - tree traversal; empty parent = roots

The flat-map representation matches how E14 ObjectService traffic
addresses nodes (by OBJSPEC string).  Wiring S14F1/F2 GetAttr and
S14F3/F4 SetAttr to this store is a downstream commit; the data model
is what was missing.

Joins EquipmentDataModel alongside the other top-level stores.  Three
test cases cover hierarchical add+dedup, children() traversal, and
get/set/missing attribute semantics.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 03:35:05 +02:00
parent cdf4049016
commit d159bd39d7
6 changed files with 234 additions and 0 deletions
+2
View File
@@ -58,6 +58,7 @@ add_library(secsgem
src/gem/load_port_state.cpp
src/gem/substrate_state.cpp
src/gem/ept_state.cpp
src/gem/cem_objects.cpp
src/gem/host_handler.cpp
src/config/loader.cpp
src/endpoint.cpp
@@ -106,6 +107,7 @@ add_executable(secsgem_tests
tests/test_carriers.cpp
tests/test_substrates.cpp
tests/test_ept.cpp
tests/test_cem_objects.cpp
)
target_link_libraries(secsgem_tests PRIVATE secsgem doctest::doctest)
target_compile_definitions(secsgem_tests PRIVATE