🧹 remove unused code

This commit is contained in:
Vladislav Nepogodin 2022-12-31 01:29:38 +04:00
parent 2ba35e0cfd
commit aefa71a6be
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9
4 changed files with 0 additions and 68 deletions

View File

@ -93,7 +93,6 @@ target_compile_features(project_options INTERFACE cxx_std_20)
add_executable(${PROJECT_NAME}
src/view.hpp
src/definitions.hpp
src/screen_service.hpp src/screen_service.cpp
src/config.cpp src/config.hpp
src/utils.cpp src/utils.hpp
src/cpu.cpp src/cpu.hpp

View File

@ -60,7 +60,6 @@ endif
src_files = files(
'src/view.hpp',
'src/definitions.hpp',
'src/screen_service.hpp', 'src/screen_service.cpp',
'src/config.cpp', 'src/config.hpp',
'src/utils.cpp', 'src/utils.hpp',
'src/cpu.cpp', 'src/cpu.hpp',

View File

@ -1,22 +0,0 @@
#include "screen_service.hpp"
#include "definitions.hpp"
#include <memory>
namespace tui {
static std::unique_ptr<screen_service> s_screen = nullptr;
bool screen_service::initialize() noexcept {
if (s_screen != nullptr) {
error_inter("You should only initialize it once!\n");
return false;
}
s_screen = std::make_unique<screen_service>();
return s_screen.get();
}
auto screen_service::instance() -> screen_service* {
return s_screen.get();
}
} // namespace tui

View File

@ -1,44 +0,0 @@
// taken from https://github.com/adrianoviana87/ltuiny
#ifndef SCREEN_SERVICE_HPP
#define SCREEN_SERVICE_HPP
//#include "view.hpp"
/* clang-format off */
//#include <memory>
#include <ftxui/component/screen_interactive.hpp> // for ScreenInteractive
/* clang-format on */
namespace tui {
class screen_service final {
public:
using value_type = ftxui::ScreenInteractive;
using reference = value_type&;
using const_reference = const value_type&;
screen_service() noexcept = default;
virtual ~screen_service() noexcept = default;
static bool initialize() noexcept;
[[gnu::pure]] static screen_service* instance();
/* clang-format off */
// Element access.
auto data() noexcept -> reference
{ return m_screen; }
auto data() const noexcept -> const_reference
{ return m_screen; }
/* clang-format on */
screen_service(const screen_service&) noexcept = delete;
screen_service& operator=(const screen_service&) noexcept = delete;
private:
value_type m_screen = ftxui::ScreenInteractive::Fullscreen();
// std::shared_ptr<tui::view> m_current_view{};
};
} // namespace tui
#endif // SCREEN_SERVICE_HPP