lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::MessageQueueCliComponent Class Reference

#include <MessageQueueCliComponent.h>

Inheritance diagram for lintel::MessageQueueCliComponent:
lintel::CommandLineComponent

Public Member Functions

 MessageQueueCliComponent (std::shared_ptr< MesssageQueueApi > messsageQueueApi)
 
void onHelp () override
 
void onCommand (const UserDto &userDto, const std::string &command, const std::vector< std::string > &parameters) override
 
void onShowMenu () override
 
bool onMenu (const std::string &component) override
 
bool onExit () override
 
void printCommandList (std::set< std::string > menuAlias) override
 
std::vector< std::string > allCommandsOf () override
 
- Public Member Functions inherited from lintel::CommandLineComponent
 CommandLineComponent (std::string_view name, std::string_view alias)
 
virtual ~CommandLineComponent ()=default
 
std::string_view getName ()
 
std::string_view getAlias ()
 
virtual std::set< std::string > menuEntriesOf ()
 

Detailed Description

CLI component that displays message queue statistics

Constructor & Destructor Documentation

◆ MessageQueueCliComponent()

lintel::MessageQueueCliComponent::MessageQueueCliComponent ( std::shared_ptr< MesssageQueueApi >  messsageQueueApi)
explicit
Parameters
messsageQueueApiAPI for retrieving message queue data

Member Function Documentation

◆ allCommandsOf()

std::vector< std::string > lintel::MessageQueueCliComponent::allCommandsOf ( )
overridevirtual
Returns
vector of all command names

Implements lintel::CommandLineComponent.

◆ onCommand()

void lintel::MessageQueueCliComponent::onCommand ( const UserDto &  userDto,
const std::string &  command,
const std::vector< std::string > &  parameters 
)
overridevirtual

Handle a command entered by the user

Implements lintel::CommandLineComponent.

◆ onExit()

bool lintel::MessageQueueCliComponent::onExit ( )
overridevirtual
Returns
true if exit was confirmed

CommandLineService currently discards the result and exits either way; a component that can veto the exit overrides this.

Implements lintel::CommandLineComponent.

◆ onHelp()

void lintel::MessageQueueCliComponent::onHelp ( )
overridevirtual

Show help for this component

Implements lintel::CommandLineComponent.

◆ onMenu()

bool lintel::MessageQueueCliComponent::onMenu ( const std::string &  component)
overridevirtual
Parameters
componentname to navigate to; return true if handled

Reached with input that CommandParser could not classify, i.e. with a free-text line rather than a real command. CommandLineService prints "Invalid command" for a component that returns false, so a component without sub-menus returns false - returning true unconditionally would swallow every typo at the prompt without a word.

Implements lintel::CommandLineComponent.

◆ onShowMenu()

void lintel::MessageQueueCliComponent::onShowMenu ( )
overridevirtual

Show the menu for this component

Implements lintel::CommandLineComponent.

◆ printCommandList()

void lintel::MessageQueueCliComponent::printCommandList ( std::set< std::string >  menuAlias)
overridevirtual

Print the list of available commands

Implements lintel::CommandLineComponent.


The documentation for this class was generated from the following file: