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"
|
#include "database_backends/db_init.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if WEB_ENABLED
|
||||||
|
#include "web/http/session_manager.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "platform/platform_initializer.h"
|
#include "platform/platform_initializer.h"
|
||||||
|
|
||||||
// Backends
|
// Backends
|
||||||
@ -69,6 +73,10 @@ RCPPFramework::RCPPFramework() {
|
|||||||
#if DATABASES_ENABLED
|
#if DATABASES_ENABLED
|
||||||
allocate_database_manager_singleton = true;
|
allocate_database_manager_singleton = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if WEB_ENABLED
|
||||||
|
allocate_session_manager_singleton = true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
RCPPFramework::~RCPPFramework() {
|
RCPPFramework::~RCPPFramework() {
|
||||||
@ -103,6 +111,13 @@ void RCPPFramework::_do_initialize() {
|
|||||||
manage_object(dbm);
|
manage_object(dbm);
|
||||||
}
|
}
|
||||||
#endif
|
#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() {
|
void RCPPFramework::_do_uninitialize() {
|
||||||
|
@ -34,6 +34,10 @@ public:
|
|||||||
bool allocate_database_manager_singleton;
|
bool allocate_database_manager_singleton;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if WEB_ENABLED
|
||||||
|
bool allocate_session_manager_singleton;
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void _do_initialize();
|
virtual void _do_initialize();
|
||||||
virtual void _do_uninitialize();
|
virtual void _do_uninitialize();
|
||||||
|
Loading…
Reference in New Issue
Block a user