Files
salmanoff/include/adapters/README.md
T
hayodea fc5ebb72b9 LivoxGen1: Port to coros
No longer uses CPS. We also found and documented a potential bug in
the way we deal with disablePcloudData during detachDeviceReq.
2026-05-28 15:17:50 -04:00

1.3 KiB

Adapter Awaiters

This directory contains coroutine/awaitable adapters that wrap callback-driven or event-driven APIs.

Placement rules

  • Put wrappers for external APIs in provider-specific subdirectories.
    • Examples: boostAsio/, opencl/, liburing/.
  • Put wrappers for SMO/internal APIs in smo/.
  • Do not place adapter awaiters in feature folders like stimBuffApis/* or smocore/* unless they are strictly private to one translation unit.

Tree layout

include/adapters/
  README.md
  boostAsio/
    <boost asio adapter awaiters>
  opencl/
    <OpenCL adapter awaiters>
  smo/
    cpsCallbackAReq.h
    livoxProto1CpsAwaiters.h
    <other SMO/internal callback adapters>

Design guidelines

  • Name adapter awaiter wrapper functions get<fnName>AReqAwaiter(), where <fnName> is the wrapped CPS/API request symbol with its library prefix removed and each _-delimited segment Pascal-cased (e.g. livoxProto1_getOrCreateDeviceReqgetGetOrCreateDeviceReqAReqAwaiter()).
  • Keep adapters small and single-purpose; but unify where possible to reduce code duplication.
  • Make result types explicit for multi-argument callbacks.
  • Resume coroutines on a caller-specified executor/io_service.
  • Avoid embedding business logic in adapters.