Embedded C++ for Real Systems
Singleton 대안 패턴 — Service Locator·Static Init·Phantom
임베디드의 DI 패턴 — Construct-On-First-Use, static dependency injection, service locator.
· 6분 읽기
cpp embedded
Tech articles, book reviews, and presentations.
페이지 33 / 56
임베디드의 DI 패턴 — Construct-On-First-Use, static dependency injection, service locator.
constexpr state machine — 컴파일 타임에 전이 검증, runtime 코드 0.
타입 안전한 상태 머신 — 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 — 임베디드의 소유권 모델 선택.