Older/WebApplication/WebApplication.h
amass d37cf655dc
Some checks failed
Deploy / Build (push) Failing after 6m49s
Deploy Docker Images / Build dockerfile and Server deploy (push) Successful in 1h12m51s
clean code.
2024-11-14 23:06:22 +08:00

46 lines
1.1 KiB
C++

#ifndef __WEBAPPLICATION_H__
#define __WEBAPPLICATION_H__
#include "Singleton.h"
#include <memory>
namespace Wt {
class WServer;
class WApplication;
class WEnvironment;
namespace Dbo {
class SqlConnectionPool;
}
namespace Auth {
class AuthService;
class PasswordService;
} // namespace Auth
}; // namespace Wt
class WebApplication {
friend class Amass::Singleton<WebApplication>;
public:
~WebApplication();
void initializeAuthenticationService();
const Wt::Auth::AuthService &authService();
const Wt::Auth::PasswordService &passwordService();
protected:
WebApplication();
static std::unique_ptr<Wt::Dbo::SqlConnectionPool> createConnectionPool(const std::string &sqlite3);
std::unique_ptr<Wt::WApplication> createApplication(const Wt::WEnvironment &env, bool embedded);
private:
std::unique_ptr<Wt::WServer> m_server;
std::unique_ptr<Wt::Dbo::SqlConnectionPool> m_sqlConnectionPool;
std::unique_ptr<Wt::Auth::AuthService> m_authService;
std::unique_ptr<Wt::Auth::PasswordService> m_passwordService;
};
#endif // __WEBAPPLICATION_H__