<commit_before>// -------------------------------------------------------------------------
//    @FileName			:    NFIPluginManager.h
//    @Author           :    LvSheng.Huang
//    @Date             :    2012-12-15
//    @Module           :    NFIPluginManager
//
// -------------------------------------------------------------------------

#ifndef NFI_PLUGIN_MANAGER_H
#define NFI_PLUGIN_MANAGER_H

#include "NFIModule.h"

#define FIND_MODULE(classBaseName, className)  \
	assert((TIsDerived<classBaseName, NFIModule>::Result));

class NFIPlugin;

class NFIPluginManager : public NFIModule
{
public:
    NFIPluginManager()
    {

    }

	template <typename T>
	T* FindModule()
	{
		NFIModule* pLogicModule = FindModule(typeid(T).name());
		if (pLogicModule)
		{
			if (!TIsDerived<T, NFIModule>::Result)
			{
				return NULL;
			}

			T* pT = dynamic_cast<T*>(pLogicModule);
			assert(NULL != pT);
<commit_msg>fixed NFIPluginModule<commit_after>// -------------------------------------------------------------------------
//    @FileName			:    NFIPluginManager.h
//    @Author           :    LvSheng.Huang
//    @Date             :    2012-12-15
//    @Module           :    NFIPluginManager
//
// -------------------------------------------------------------------------

#ifndef NFI_PLUGIN_MANAGER_H
#define NFI_PLUGIN_MANAGER_H

#include "NFIModule.h"

#define FIND_MODULE(classBaseName, className)  \
	assert((TIsDerived<classBaseName, NFIModule>::Result));

class NFIPlugin;

class NFIPluginManager : public NFIModule
{
public:
    NFIPluginManager()
    {

    }

	template <typename T>
	T* FindModule()
	{
#if NF_PLATFORM == NF_PLATFORM_WIN
		NFIModule* pLogicModule = FindModule(typeid(T).name());
#else
        std::string strModuleName = typeid(T).name();
        for(int i = 0; i < strModuleName.length(); i++)
        {
            std::string s = strModuleName.substr(0, i+1);
            int n = atof(s.c_str());
            if (strModuleName.length() == i + 1 + n)
            {
                strModuleName = strModuleName.substr(i + 1, strModuleName.length());
                break;
            }
        }
        NFIModule* pLogicModule = FindModule(strModuleName.c_str());
#endif
		if (pLogicModule)
		{
			if (!TIsDerived<T, NFIModule>::Result)
			{
				return NULL;
			}

			T* pT = dynamic_cast<T*>(pLogicModule);
			assert(NULL != pT);

{'fraction_non_alphanumeric': 0.23954372623574144, 'fraction_numerical': 0.008871989860583017, 'mean_word_length': 1.672686230248307, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6331538', 'n_tokens_mistral': 813, 'n_tokens_neox': 771, 'n_words': 131}