some work on dependency injection

git-svn-id: svn://ttmath.org/publicrep/winix/branches/0.7.x@1147 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2018-11-21 17:51:15 +00:00
parent a2ffc1e81c
commit 89d303f375
64 changed files with 1734 additions and 1161 deletions

View File

@@ -55,7 +55,7 @@ class Functions;
class Templates;
class SessionManager;
class WinixSystem;
class WinixRequest;
@@ -80,6 +80,7 @@ class Plugin;
class Session;
// move me to a different file
struct PluginInfo
{
// these variables are used for some purposes
@@ -103,9 +104,7 @@ struct PluginInfo
Synchro * synchro;
SessionManager * session_manager;
// temporarily?
Log log;
WinixSystem * winix_system;
Plugin * plugin;
@@ -127,8 +126,17 @@ struct PluginInfo
// function return status
// default: false (if not set by the plugin)
bool res;
void set_dependency_for(WinixBase * winix_base);
void set_dependency_for(WinixBase & winix_base)
{
set_dependency_for(&winix_base);
}
void Clear()
{
// pointers to winix objects are not cleared here
@@ -144,6 +152,7 @@ struct PluginInfo
res = false;
}
};
@@ -214,7 +223,7 @@ public:
//void SetSynchro(Synchro * psynchro);
void SetSessionManager(SessionManager * psession_manager);
void SetWinixSystem(WinixSystem * winix_system);
void SetWinixRequest(WinixRequest * winix_request);
void LoadPlugin(const wchar_t * filename);
void LoadPlugin(const std::wstring & filename);
@@ -268,7 +277,7 @@ private:
//Synchro * synchro;
SessionManager * session_manager;
WinixSystem * winix_system;
WinixRequest * winix_request;
std::wstring temp_path; // used when loading plugins
@@ -281,8 +290,11 @@ private:
void Call(Session * ses, int message, Slots::iterator & slot, PluginInfo & info);
bool SetDependency(PluginInfo & info);
void SetDependencyFor(WinixBase * winix_base);
void Lock();
void Unlock();
friend PluginInfo;
};