33 lines
964 B
C++
33 lines
964 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
class ServiceMenu
|
|
{
|
|
public:
|
|
// --- Métodos de singleton ---
|
|
static void init(); // Inicializa el objeto ServiceMenu
|
|
static void destroy(); // Libera el objeto ServiceMenu
|
|
static ServiceMenu *get(); // Obtiene el puntero al objeto ServiceMenu
|
|
|
|
void show();
|
|
void render();
|
|
void handle_input();
|
|
void execute_option(size_t option);
|
|
|
|
private:
|
|
// --- Patrón Singleton ---
|
|
ServiceMenu(); // Constructor privado
|
|
~ServiceMenu() = default; // Destructor privado
|
|
ServiceMenu(const ServiceMenu &) = delete; // Evitar copia
|
|
ServiceMenu &operator=(const ServiceMenu &) = delete; // Evitar asignación
|
|
|
|
// --- Singleton ---
|
|
static ServiceMenu *instance_;
|
|
|
|
// -- Variables internas ---
|
|
bool is_active;
|
|
size_t selected_option;
|
|
std::vector<std::string> options;
|
|
}; |