Browse Subversion Repository
Contents of /trunk/nsmsgs/src/UNsmPlugin.h
Parent Directory
| Revision Log
Revision 119 -
( show annotations)
( download)
( as text)
Fri Oct 8 15:41:45 2010 UTC
(13 years, 7 months ago)
by kamoya
File MIME type: text/x-chdr
File size: 1796 byte(s)
avoid ARRAYSIZE macro
| 1 |
/* NSM プラグイン関連ユニット */ |
| 2 |
|
| 3 |
#ifndef UNSM_PLUGIN_H |
| 4 |
#define UNSM_PLUGIN_H |
| 5 |
|
| 6 |
#include <vector> |
| 7 |
#include <memory> |
| 8 |
|
| 9 |
#include "../../Common/tstring.h" |
| 10 |
|
| 11 |
#include "UNsmTypes.h" |
| 12 |
|
| 13 |
namespace Regnessem |
| 14 |
{ |
| 15 |
namespace System |
| 16 |
{ |
| 17 |
class NsmPlugin; |
| 18 |
typedef std::shared_ptr<NsmPlugin> NsmPluginListSub; |
| 19 |
typedef std::vector<NsmPluginListSub> NsmPluginList; |
| 20 |
|
| 21 |
// プラグインのラッパー |
| 22 |
class NsmPlugin |
| 23 |
{ |
| 24 |
private: |
| 25 |
// プラグイン情報を得る |
| 26 |
typedef int (__stdcall TGetPluginInfo)(int nInfoNo, LPSTR lpBuffer, int nSize); |
| 27 |
// プラグインを初期化 |
| 28 |
typedef int (__stdcall TInitialize)(PNsmPluginInitInfo lpPluginInitInfo); |
| 29 |
// プラグインを終了 |
| 30 |
typedef int (__stdcall TTerminate)(); |
| 31 |
|
| 32 |
const HMODULE DllHandle; |
| 33 |
TGetPluginInfo* HGetPluginInfo; |
| 34 |
TInitialize* HInitialize; |
| 35 |
TTerminate* HTerminate; |
| 36 |
|
| 37 |
FARPROC ProcAddress(LPCSTR procName) const; |
| 38 |
|
| 39 |
NsmPlugin(const NsmPlugin &); |
| 40 |
NsmPlugin& operator=(const NsmPlugin &); |
| 41 |
public: |
| 42 |
struct FindByModuleName |
| 43 |
{ |
| 44 |
const tstring x; |
| 45 |
explicit FindByModuleName(const tstring &s); |
| 46 |
bool operator()(const NsmPluginListSub &v)const; |
| 47 |
private: |
| 48 |
FindByModuleName& operator=(const FindByModuleName &); |
| 49 |
}; |
| 50 |
|
| 51 |
struct NsmPluginInfoEx |
| 52 |
{ |
| 53 |
tstring ApiVersion; |
| 54 |
tstring ModuleName; |
| 55 |
tstring DisplayName; |
| 56 |
tstring Description; |
| 57 |
tstring Author; |
| 58 |
tstring Copyright; |
| 59 |
tstring PluginVersion; |
| 60 |
} PluginInfo; |
| 61 |
|
| 62 |
tstring FileName; |
| 63 |
|
| 64 |
explicit NsmPlugin(const tstring &filePath); |
| 65 |
~NsmPlugin(); |
| 66 |
bool IsLoaded() const; |
| 67 |
int GetPluginInfo(int infoNo, LPSTR lpBuffer, int nSize) const; |
| 68 |
tstring GetPluginInfoEx(int infoNo) const; |
| 69 |
int Initialize(PNsmPluginInitInfo lpPluginInitInfo) const; |
| 70 |
int Terminate() const; |
| 71 |
}; |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
#endif |
|