libzypp 17.37.10

application.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8----------------------------------------------------------------------/
9*
10* This file contains private API, this might break at any time between releases.
11* Strictly for internal use!
12*/
13
14#ifndef ZYPP_TUI_TUIAPPLICATION_INCLUDED
15#define ZYPP_TUI_TUIAPPLICATION_INCLUDED
16
17#include <zypp-core/base/NonCopyable.h>
18#include <zypp-tui/Config>
19#include <memory>
20
21 namespace ztui {
22
23 class Out;
24 static constexpr int ZTUI_EXIT_OK = 0;
25
26 class Application : private zypp::base::NonCopyable
27 {
28 public:
29 Application();
30 virtual ~Application();
31
36 static Application & instance();
37
38 const Config &config () const;
39 Config &mutableConfig();
40
41 virtual Out & out();
42 virtual void setOutputWriter( Out * out );
43
44 int exitCode() const { return _exitCode; }
45 void setExitCode( int exit );
46
47 protected:
48 Application ( std::shared_ptr<Config> &&cfg );
49
50 private:
51 void init();
52 int _exitCode;
53 std::shared_ptr<Config> _config;
54 std::shared_ptr<Out> _out;
55 };
56}
57
58
59
60#endif
ztui::Application::setOutputWriter
virtual void setOutputWriter(Out *out)
Definition application.cc:71
ztui::Application::_out
std::shared_ptr< Out > _out
Definition application.h:54
ztui::Application::_config
std::shared_ptr< Config > _config
Definition application.h:53
ztui::Application::Application
Application()
Definition application.cc:22
ztui::Application::~Application
virtual ~Application()
ztui::Application::instance
static Application & instance()
Definition application.cc:45
ztui::Application::out
virtual Out & out()
Definition application.cc:63
ztui::Application::exitCode
int exitCode() const
Definition application.h:44
ztui::Application::config
const Config & config() const
Definition application.cc:53
ztui::Application::mutableConfig
Config & mutableConfig()
Definition application.cc:58
ztui::Application::_exitCode
int _exitCode
Definition application.h:52
ztui::Config
Definition config.h:21
ztui::Out
Base class for producing common (for now) zypper output.
Definition Out.h:424
zypp::Application::Application
Application(const sat::Solvable &solvable_r)
Ctor.
Definition Application.cc:23
ztui
Definition application.cc:13
ztui::ZTUI_EXIT_OK
static constexpr int ZTUI_EXIT_OK
Definition application.h:24
zypp::base::NonCopyable
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition NonCopyable.h:26
NonCopyable.h