Permalink
Browse files

Add a way for module to customize additional info.

For that you need to write a specialization of template function
void TModInfo<CYourModule>(CModInfo&), and inside it put needed values
to the argument.
  • Loading branch information...
Alexey Sokolov
Alexey Sokolov committed Jun 11, 2011
1 parent ad9f1f8 commit e6e3331457aa50051b2cc9af2816c379e9e95227
Showing with 3 additions and 0 deletions.
  1. +3 −0 Modules.h
View
@@ -42,6 +42,8 @@ class CModInfo;
typedef void* ModHandle;
+template<class M> void TModInfo(CModInfo& Info) {}
+
template<class M> CModule* TModLoad(ModHandle p, CUser* pUser,
const CString& sModName, const CString& sModPath) {
return new M(p, pUser, sModName, sModPath);
@@ -61,6 +63,7 @@ template<class M> CGlobalModule* TModLoadGlobal(ModHandle p,
Info->SetDescription(DESCRIPTION); \
Info->SetGlobal(GLOBAL); \
LOADER; \
+ TModInfo<CLASS>(*Info); \
return Info; \
} \
}

0 comments on commit e6e3331

Please sign in to comment.