[cli] update CLI Output class (#8343)

This commit updates the `Cli::Output` class and the related types. A
new type `OutputImplementer` is added which provides the basic output
functionality, i.e., method `OutputV()`. `Output` class requires a
reference to an `OutputImplementer` which it then uses to provide all
the different `Output{}()` method flavors. The new model allows all
CLI sub-modules to directly inherit `Output` class while reusing a
single and common underlying `OutputImplementer` provided by the
`Cli::Interpreter`.
This commit is contained in:
Abtin Keshavarzian
2022-11-01 13:28:37 -07:00
committed by GitHub
parent 11a24d111f
commit f5acfb2dac
20 changed files with 131 additions and 173 deletions
+2 -2
View File
@@ -43,8 +43,8 @@
namespace ot {
namespace Cli {
UdpExample::UdpExample(Output &aOutput)
: OutputWrapper(aOutput)
UdpExample::UdpExample(otInstance *aInstance, OutputImplementer &aOutputImplementer)
: Output(aInstance, aOutputImplementer)
, mLinkSecurityEnabled(true)
{
memset(&mSocket, 0, sizeof(mSocket));