semf
command.h
Go to the documentation of this file.
1
10#ifndef SEMF_COMMUNICATION_ESH_COMMAND_H_
11#define SEMF_COMMUNICATION_ESH_COMMAND_H_
12
18#include <string_view>
19
20namespace semf::esh
21{
22class Shell;
23
27class Command : public LinkedList<Command>::Node
28{
29public:
37 Command(std::string_view name, std::string_view help, SlotBase<int, char**, Printer&, int&>& callback, Shell& esh);
44 Command(std::string_view name, std::string_view help, Shell& esh);
50 Command(std::string_view name, std::string_view help);
51 Command(const Command& other) = delete;
52 virtual ~Command() = default;
57 std::string_view name() const;
62 std::string_view help() const;
64 SEMF_SIGNAL(command, int, char**, Printer&, int&);
65
66private:
68 const std::string_view m_name;
70 const std::string_view m_help;
71};
72} // namespace semf::esh
73#endif // SEMF_COMMUNICATION_ESH_COMMAND_H_
LinkedList is an managed double linked list implementation.
Definition: linkedlist.h:43
Base Class for all Slot implementations.
Definition: slotbase.h:25
Wrapper class for shell command. The user has to create object of this class for adding their functio...
Definition: command.h:28
Command(const Command &other)=delete
Command(std::string_view name, std::string_view help, SlotBase< int, char **, Printer &, int & > &callback, Shell &esh)
Constructor. Adds the command to its shell.
Definition: command.cpp:15
SEMF_SIGNAL(command, int, char **, Printer &, int &)
std::string_view name() const
Returns the command's name.
Definition: command.cpp:32
std::string_view help() const
Returns the command's help text.
Definition: command.cpp:37
virtual ~Command()=default
Class for string related UART communication. Using this class outside of an esh-context can make sens...
Definition: printer.h:25
This class manages a semf's embedded shell (esh) operating on a single UART. The esh can be used for ...
Definition: shell.h:34