Embedded C++ for Real Systems
임베디드 State Machine 패턴 — Variant·Visitor·Table-driven 비교
타입 안전한 상태 머신 — enum + switch부터 std::variant, etl::fsm까지.
· 7분 읽기
cpp embedded
Tech articles, book reviews, and presentations.
페이지 33 / 56
타입 안전한 상태 머신 — enum + switch부터 std::variant, etl::fsm까지.
enum class + bit operators — type-safe 비트 플래그. 의도하지 않은 변환 차단.
SPSC queue, MPMC stack, ring buffer — lock-free 자료구조 구현 패턴.
Atomic, CAS, memory order — mutex 없이 동시성. 임베디드의 ISR-safe 패턴.
Embedded Template Library — heap 없는 STL 대체, fsm, message router 포함.
객체가 자기 next pointer 보유 — 동적 할당 없는 linked list와 tree.
Owner, observer, borrower — 객체 lifetime의 명확한 책임 할당.
unique_ptr vs shared_ptr vs raw pointer — 임베디드의 소유권 모델 선택.
-fno-rtti 환경에서 type info 없이 다형성 — enum tag, std::variant, CRTP.
C++23의 Result type — Rust 같은 monadic 에러 처리, 예외 없이 풍부한 정보.