Older/WebApplication/WebApplication.h

41 lines
851 B
C
Raw Normal View History

2024-10-30 23:59:59 +08:00
#ifndef __WEBAPPLICATION_H__
#define __WEBAPPLICATION_H__
#include <memory>
2024-11-11 19:21:48 +08:00
#include "Singleton.h"
2024-10-30 23:59:59 +08:00
namespace Wt {
class WServer;
2024-11-07 18:21:04 +08:00
namespace Dbo {
class SqlConnectionPool;
}
2024-11-11 19:21:48 +08:00
namespace Auth {
class AuthService;
class PasswordService;
} // namespace Auth
2024-11-07 18:21:04 +08:00
}; // namespace Wt
2024-10-30 23:59:59 +08:00
class WebApplication {
2024-11-11 19:21:48 +08:00
friend class Amass::Singleton<WebApplication>;
2024-10-30 23:59:59 +08:00
public:
~WebApplication();
2024-11-11 19:21:48 +08:00
void initializeAuthenticationService();
const Wt::Auth::AuthService &authService();
const Wt::Auth::PasswordService &passwordService();
protected:
WebApplication();
2024-10-30 23:59:59 +08:00
private:
std::unique_ptr<Wt::WServer> m_server;
2024-11-07 18:21:04 +08:00
std::unique_ptr<Wt::Dbo::SqlConnectionPool> m_blogSqlConnectionPool;
2024-11-11 19:21:48 +08:00
std::unique_ptr<Wt::Auth::AuthService> m_authService;
std::unique_ptr<Wt::Auth::PasswordService> m_passwordService;
2024-10-30 23:59:59 +08:00
};
#endif // __WEBAPPLICATION_H__