Skip to content

claw: Linux kernel-style OOP refactoring #96

@zevorn

Description

@zevorn

Goal

Apply Linux kernel OOP design patterns to refactor all major RT-Claw subsystems, following the methodology from LWN Articles 444910 and 446317.

Design Patterns

  • Struct embedding + container_of for data inheritance (replacing all void* opaque handles)
  • Function pointer tables (ops structs) for polymorphism and method dispatch
  • Linker section auto-registration for zero-cost component discovery (GNU ld) / __attribute__((constructor)) (ESP-IDF)
  • Unified error codes (claw_err_t) and base class definitions as shared infrastructure

Scope

  • OSAL layer: struct-based types replacing void*
  • Gateway: polymorphic message dispatch via ops vtable
  • Services: private context structs with lifecycle state machine and dependency graph
  • Drivers: probe/remove lifecycle with struct claw_driver base
  • Tools: struct claw_tool base class with ops vtable
  • Scheduler: intrusive linked list replacing static array
  • All 5 platforms: ESP32-C3, ESP32-S3, vexpress-a9, zynq-a9, Linux

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions