start working on 0.7.x branch
- added FileLog which stores content to the file log - now Log is only a wrapper - it puts messages to the local buffer and when logsave is used then the buffer is put to FileLog - new base classes: WinixBase (Log, Config*, Synchro*) WinixModel : public WinixBase (morm::ModelConnector*, Plugin*) WinixSystem : public WinixModel (System*) WinixRequest : public WinixSystem (SLog, Cur*) - singletons: log, slog, plugin are depracated - now references to them are in base classses (WinixBase, WinixModel) - DbBase, DbConn and Db are depracated - now we are using Morm project (in WinixModel there is a model_connector pointer) each thread will have its own ModelConnector git-svn-id: svn://ttmath.org/publicrep/winix/branches/0.7.x@1146 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||
* Copyright (c) 2008-2018, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -39,20 +39,23 @@
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "pluginmsg.h"
|
||||
#include "log.h"
|
||||
#include "plugindata.h"
|
||||
#include "config.h"
|
||||
#include "request.h"
|
||||
#include "system.h"
|
||||
#include "sessionmanager.h"
|
||||
#include "synchro.h"
|
||||
#include "functions/functions.h"
|
||||
#include "templates/templates.h"
|
||||
#include "winixbase.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Winix
|
||||
{
|
||||
class Db;
|
||||
class Cur;
|
||||
class System;
|
||||
class Functions;
|
||||
class Templates;
|
||||
class SessionManager;
|
||||
|
||||
class WinixSystem;
|
||||
|
||||
|
||||
|
||||
@@ -73,6 +76,8 @@ namespace Winix
|
||||
*/
|
||||
|
||||
|
||||
class Plugin;
|
||||
class Session;
|
||||
|
||||
|
||||
struct PluginInfo
|
||||
@@ -87,6 +92,7 @@ struct PluginInfo
|
||||
// unique plugin identifier
|
||||
int plugin_id;
|
||||
|
||||
|
||||
// objects from winix which are accessible from a plugin
|
||||
Db * db;
|
||||
Config * config;
|
||||
@@ -97,6 +103,13 @@ struct PluginInfo
|
||||
Synchro * synchro;
|
||||
SessionManager * session_manager;
|
||||
|
||||
// temporarily?
|
||||
Log log;
|
||||
WinixSystem * winix_system;
|
||||
|
||||
Plugin * plugin;
|
||||
|
||||
|
||||
// a session
|
||||
// some messages are sent in a session's context e.g. logging a user
|
||||
// this pointer in not always the same as cur->session, it is preferred
|
||||
@@ -151,7 +164,7 @@ struct PluginRes
|
||||
|
||||
|
||||
|
||||
class Plugin
|
||||
class Plugin : public WinixBase
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -193,14 +206,16 @@ public:
|
||||
~Plugin();
|
||||
|
||||
void SetDb(Db * pdb);
|
||||
void SetConfig(Config * pconfig);
|
||||
//void SetConfig(Config * pconfig);
|
||||
void SetCur(Cur * pcur);
|
||||
void SetSystem(System * psystem);
|
||||
void SetFunctions(Functions * pfunctions);
|
||||
void SetTemplates(Templates * ptemplates);
|
||||
void SetSynchro(Synchro * psynchro);
|
||||
//void SetSynchro(Synchro * psynchro);
|
||||
void SetSessionManager(SessionManager * psession_manager);
|
||||
|
||||
void SetWinixSystem(WinixSystem * winix_system);
|
||||
|
||||
void LoadPlugin(const wchar_t * filename);
|
||||
void LoadPlugin(const std::wstring & filename);
|
||||
|
||||
@@ -245,14 +260,16 @@ public:
|
||||
private:
|
||||
|
||||
Db * db;
|
||||
Config * config;
|
||||
//Config * config;
|
||||
Cur * cur;
|
||||
System * system;
|
||||
Functions * functions;
|
||||
Templates * templates;
|
||||
Synchro * synchro;
|
||||
//Synchro * synchro;
|
||||
SessionManager * session_manager;
|
||||
|
||||
WinixSystem * winix_system;
|
||||
|
||||
std::wstring temp_path; // used when loading plugins
|
||||
|
||||
Plugins plugins;
|
||||
@@ -263,17 +280,13 @@ private:
|
||||
void * LoadInitFun(const wchar_t * filename, Fun1 & fun_init);
|
||||
void Call(Session * ses, int message, Slots::iterator & slot, PluginInfo & info);
|
||||
|
||||
bool SetPointers(PluginInfo & info);
|
||||
bool SetDependency(PluginInfo & info);
|
||||
void Lock();
|
||||
void Unlock();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
extern Plugin plugin;
|
||||
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user