|
HardFOC Core
API reference
|
Thin BaseAdc delegation wrapper when the host owns a unique_ptr. More...
#include "base/BaseAdc.h"Go to the source code of this file.
Classes | |
| class | Tmc9660AdcWrapper |
| Delegation wrapper that adapts Tmc9660Handler::Adc for external ownership. More... | |
Thin BaseAdc delegation wrapper when the host owns a unique_ptr.
The TMC9660's ADC functionality is implemented by Tmc9660Handler::Adc (an inner class of Tmc9660Handler that inherits from BaseAdc). The handler owns this inner class instance and exposes it via Tmc9660Handler::adc().
A host that needs to own a std::unique_ptr<BaseAdc> cannot take ownership of the inner class. This wrapper bridges that gap:
Every BaseAdc virtual method in this class is a one-line delegation to the handler's Adc instance. No additional logic, buffering, or transformation is performed.
The Tmc9660Handler referenced by this wrapper must remain alive for the entire lifetime of the wrapper. The host that owns both objects is responsible for matching those lifetimes.