mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Now the RCPPFramework singleton cal also automatically allocate the SessionManager singleton.
This commit is contained in:
parent
cf7458caaf
commit
ffbdae1520
@ -7,6 +7,10 @@
|
||||
#include "database_backends/db_init.h"
|
||||
#endif
|
||||
|
||||
#if WEB_ENABLED
|
||||
#include "web/http/session_manager.h"
|
||||
#endif
|
||||
|
||||
#include "platform/platform_initializer.h"
|
||||
|
||||
// Backends
|
||||
@ -69,6 +73,10 @@ RCPPFramework::RCPPFramework() {
|
||||
#if DATABASES_ENABLED
|
||||
allocate_database_manager_singleton = true;
|
||||
#endif
|
||||
|
||||
#if WEB_ENABLED
|
||||
allocate_session_manager_singleton = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
RCPPFramework::~RCPPFramework() {
|
||||
@ -103,6 +111,13 @@ void RCPPFramework::_do_initialize() {
|
||||
manage_object(dbm);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if WEB_ENABLED
|
||||
if (allocate_session_manager_singleton) {
|
||||
::SessionManager *session_manager = new ::SessionManager();
|
||||
RCPPFramework::get_singleton()->manage_object(session_manager);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void RCPPFramework::_do_uninitialize() {
|
||||
|
@ -34,6 +34,10 @@ public:
|
||||
bool allocate_database_manager_singleton;
|
||||
#endif
|
||||
|
||||
#if WEB_ENABLED
|
||||
bool allocate_session_manager_singleton;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void _do_initialize();
|
||||
virtual void _do_uninitialize();
|
||||
|
Loading…
Reference in New Issue
Block a user