doxygen comments

This commit is contained in:
2023-10-12 19:50:26 +02:00
parent f05ab56833
commit 9b8bf22795
11 changed files with 1346 additions and 1014 deletions
+76 -67
View File
@@ -1,67 +1,76 @@
/**
* @file menuAction.cpp
* @author Alexander Klein (alex@kleiax.de)
* @brief Implentation of the class MenuAction
* @version 0.1
* @date 2022-01-12
*
* @copyright Copyright (c) 2022
*
*/
#include "menuAction.h"
MenuAction::MenuAction(const char* name, void (*function) (), void (*callback) ()) {
this->name = name;
this->function = function;
this->callback = callback;
}
MenuAction::MenuAction(const char* name, MenuControl* menu) {
this->name = name;
this->menu = menu;
this->isMenu = true;
}
MenuAction::MenuAction(const char* name, MenuActionWrapper* action) {
this->name = name;
this->action = action;
}
MenuAction::~MenuAction() {
if (this->menu)
delete this->menu;
if (this->action)
delete this->action;
}
void MenuAction::runAction() {
if (isMenu)
this->menu->printMenu();
else {
if (this->function)
this->function();
else if (this->action)
this->action->action();
else
std::cout << "Error in MenuAction::runAction" << std::endl;
}
if (this->callback)
this->callback();
}
const char* MenuAction::getName() {
return this->name;
}
bool MenuAction::getIsMenu() {
return this->isMenu;
}
MenuControl* MenuAction::getMenu() {
if (isMenu)
return this->menu;
else
return nullptr;
}
/**
* @file menuAction.cpp
* @author Alexander Klein (alex@kleiax.de)
* @brief Implentation of the class MenuAction
* @version 0.1
* @date 2022-01-12
*
* @copyright Copyright (c) 2022
*
*/
#include "menuAction.h"
MenuAction::MenuAction(const char *name, void (*function)(), void (*callback)())
{
this->name = name;
this->function = function;
this->callback = callback;
}
MenuAction::MenuAction(const char *name, MenuControl *menu)
{
this->name = name;
this->menu = menu;
this->isMenu = true;
}
MenuAction::MenuAction(const char *name, MenuActionWrapper *action)
{
this->name = name;
this->action = action;
}
MenuAction::~MenuAction()
{
if (this->menu)
delete this->menu;
if (this->action)
delete this->action;
}
void MenuAction::runAction()
{
if (isMenu)
this->menu->printMenu();
else
{
if (this->function)
this->function();
else if (this->action)
this->action->action();
else
std::cout << "Error in MenuAction::runAction" << std::endl;
}
if (this->callback)
this->callback();
}
const char *MenuAction::getName()
{
return this->name;
}
bool MenuAction::getIsMenu()
{
return this->isMenu;
}
MenuControl *MenuAction::getMenu()
{
if (isMenu)
return this->menu;
else
return nullptr;
}