#ifndef __WEBAPPLICATION_H__ #define __WEBAPPLICATION_H__ #include "Singleton.h" #include #include namespace Wt { class WServer; class WApplication; class WEnvironment; namespace Auth { class AuthService; class PasswordService; } // namespace Auth }; // namespace Wt class Session; namespace WebToolkit { class Application : public Wt::WApplication { public: Application(const Wt::WEnvironment &env, bool embedded); ~Application(); protected: void authEvent(); void handlePathChange(const std::string &path); private: std::unique_ptr m_session; std::string m_externalPath; Wt::WContainerWidget *m_root = nullptr; }; class Server { friend class Amass::Singleton; public: ~Server(); void initializeAuthenticationService(); const Wt::Auth::AuthService &authService(); const Wt::Auth::PasswordService &passwordService(); protected: Server(uint16_t port, const std::string &applicationRoot, const std::string &documentRoot); std::unique_ptr createApplication(const Wt::WEnvironment &env, bool embedded); private: std::unique_ptr m_server; std::unique_ptr m_authService; std::unique_ptr m_passwordService; }; } // namespace WebToolkit #endif // __WEBAPPLICATION_H__