semf
semf::esh::Command Class Reference

Wrapper class for shell command. The user has to create object of this class for adding their functionality to the shell. More...

#include <command.h>

Inheritance diagram for semf::esh::Command:
Inheritance graph
Collaboration diagram for semf::esh::Command:
Collaboration graph

Public Member Functions

 Command (std::string_view name, std::string_view help, SlotBase< int, char **, Printer &, int & > &callback, Shell &esh)
 Constructor. Adds the command to its shell. More...
 
 Command (std::string_view name, std::string_view help, Shell &esh)
 Constructor. Adds the command to its shell, without providing a callback immediately. More...
 
 Command (std::string_view name, std::string_view help)
 Constructor. Adds the command to its shell, without providing a callback immediately. More...
 
 Command (const Command &other)=delete
 
virtual ~Command ()=default
 
std::string_view name () const
 Returns the command's name. More...
 
std::string_view help () const
 Returns the command's help text. More...
 
 SEMF_SIGNAL (command, int, char **, Printer &, int &)
 
- Public Member Functions inherited from semf::LinkedList< T >::Node
virtual ~Node ()=default
 
T * next () const
 Returns a pointer to the next element in a list. More...
 
void setNext (T *next)
 Sets a pointer to the next element in a list. More...
 
T * previous () const
 Returns a pointer to the previous element in a list. More...
 
void setPrevious (T *previous)
 Sets a pointer to the previous element in a list. More...
 
bool isInAList ()
 Returns if a node is part of a LinkedList. More...
 

Detailed Description

Wrapper class for shell command. The user has to create object of this class for adding their functionality to the shell.

Definition at line 27 of file command.h.

Constructor & Destructor Documentation

◆ Command() [1/4]

semf::esh::Command::Command ( std::string_view  name,
std::string_view  help,
SlotBase< int, char **, Printer &, int & > &  callback,
Shell esh 
)

Constructor. Adds the command to its shell.

Parameters
nameName of the command. Sending the name via to the shell triggers this command.
helpHelp description.
callbackCallback slot.
eshThe shell this command belongs to.

Definition at line 15 of file command.cpp.

◆ Command() [2/4]

semf::esh::Command::Command ( std::string_view  name,
std::string_view  help,
Shell esh 
)

Constructor. Adds the command to its shell, without providing a callback immediately.

Parameters
nameName of the command. Sending the name via to the shell triggers this command.
helpHelp description.
eshThe shell this command belongs to.

Definition at line 21 of file command.cpp.

Here is the call graph for this function:

◆ Command() [3/4]

semf::esh::Command::Command ( std::string_view  name,
std::string_view  help 
)

Constructor. Adds the command to its shell, without providing a callback immediately.

Parameters
nameName of the command. Sending the name via to the shell triggers this command.
helpHelp description.

Definition at line 27 of file command.cpp.

◆ Command() [4/4]

semf::esh::Command::Command ( const Command other)
delete

◆ ~Command()

virtual semf::esh::Command::~Command ( )
virtualdefault

Member Function Documentation

◆ help()

std::string_view semf::esh::Command::help ( ) const

Returns the command's help text.

Returns
Command's help text.

Definition at line 37 of file command.cpp.

◆ name()

std::string_view semf::esh::Command::name ( ) const

Returns the command's name.

Returns
Command's name.

Definition at line 32 of file command.cpp.

◆ SEMF_SIGNAL()

semf::esh::Command::SEMF_SIGNAL ( command  ,
int  ,
char **  ,
Printer ,
int &   
)

Gets emitted when the command is about to be executed.