<commit_before>#include "application.h"
#include "memory.h"

Application::Application()
{
	memset(&m_callbacks, 0, sizeof(m_callbacks));
}

Application::~Application()
{
}

void Application::ManagerFunc()
{
	std::vector<NotificationMessage*> messages;
	{
		CSLocker locker(&m_csMessages);
		messages = m_messages;
		m_messages.clear();
	}
	for(std::vector<NotificationMessage*>::iterator it = messages.begin();
		it != messages.end(); it++)
	{
		(*it)->HandleMessage(m_callbacks);
		delete *it;
	}
}

void Application::ManagerStop()
{
	{
		CSLocker locker(&m_csModules);
		for(std::vector<TwainetModule*>::iterator it = m_modules.begin(); it != m_modules.end();)
		{
			(*it)->Exit();
			delete *it;
			it = m_modules.erase(it);
		}
	}
	{
		CSLocker locker(&m_csMessages);
		for(std::vector<NotificationMessage*>::iterator it = m_messages.begin(); it != m_messages.end();)
		{
			delete *it;
			it = m_messages.erase(it);
		}
	}
}

void Application::Init(const Twainet::TwainetCallback& callback)
{
	memcpy(&m_callbacks, &callback, sizeof(m_callbacks));
}

TwainetModule* Application::CreateModule(const Twainet::ModuleName& moduleName, bool isPPPListener)
{
	CSLocker locker(&m_csModules);
	TwainetModule* module = new TwainetModule(IPCObjectName(moduleName.m_name, moduleName.m_host, moduleName.m_suffix), isPPPListener);
	m_modules.push_back(module);
	return module;
}
<commit_msg>remove ppp library<commit_after>#include "application.h"
#include "memory.h"

Application::Application()
{
	memset(&m_callbacks, 0, sizeof(m_callbacks));
}

Application::~Application()
{
}

void Application::ManagerFunc()
{
	std::vector<NotificationMessage*> messages;
	{
		CSLocker locker(&m_csMessages);
		messages = m_messages;
		m_messages.clear();
	}
	for(std::vector<NotificationMessage*>::iterator it = messages.begin();
		it != messages.end(); it++)
	{
		(*it)->HandleMessage(m_callbacks);
		delete *it;
	}
}

void Application::ManagerStop()
{
	{
		CSLocker locker(&m_csModules);
		for(std::vector<TwainetModule*>::iterator it = m_modules.begin(); it != m_modules.end();)
		{
			(*it)->Exit();
			delete *it;
			it = m_modules.erase(it);
		}
	}
	{
		CSLocker locker(&m_csMessages);
		for(std::vector<NotificationMessage*>::iterator it = m_messages.begin(); it != m_messages.end();)
		{
			delete *it;
			it = m_messages.erase(it);
		}
	}
}

void Application::Init(const Twainet::TwainetCallback& callback)
{
	memcpy(&m_callbacks, &callback, sizeof(m_callbacks));
}

TwainetModule* Application::CreateModule(const Twainet::ModuleName& moduleName)
{
	CSLocker locker(&m_csModules);
	TwainetModule* module = new TwainetModule(IPCObjectName(moduleName.m_name, moduleName.m_host, moduleName.m_suffix));
	m_modules.push_back(module);
	return module;
}

{'fraction_non_alphanumeric': 0.16362308254200147, 'fraction_numerical': 0.0007304601899196494, 'mean_word_length': 6.095854922279793, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '5206543', 'n_tokens_mistral': 1029, 'n_tokens_neox': 980, 'n_words': 153}