forked from LosaDev/ls-2019-source
LosaDev source snapshot 2019
This commit is contained in:
commit
c198676e97
20588 files changed
+8812878
No files matched your search
@@ -0,0 +1,63 @@
|
||||
// cConnectorThread.cpp: implementation of the cConnectorThread class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "cConnectorQueue.h"
|
||||
#include "cConnectorQueueElem.h"
|
||||
#include "cConnectorThread.h"
|
||||
#include "cConnectorManager.h"
|
||||
#include "cSystem.h"
|
||||
#include "../include/cSingleton.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
cConnectorThread::cConnectorThread()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
cConnectorThread::~cConnectorThread()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void cConnectorThread::Init()
|
||||
{
|
||||
}
|
||||
|
||||
void cConnectorThread::Destroy()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// operation
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void cConnectorThread::Process()
|
||||
{
|
||||
cConnectorQueue* connectorQueue = cSingleton<cSystem>::GetInstance()->GetConnectorQueue();
|
||||
if( !connectorQueue ) return;
|
||||
|
||||
Trace( _T("ConnectorThread :: %lu\n"), GetCurrentThreadId() );
|
||||
|
||||
cNetwork* network = cSingleton<cSystem>::GetInstance()->GetNetwork();
|
||||
|
||||
cConnectorQueueElem* command = NULL;
|
||||
while( !IsTerminated() )
|
||||
{
|
||||
command = reinterpret_cast<cConnectorQueueElem*>(connectorQueue->Dequeue());
|
||||
if( command )
|
||||
{
|
||||
// process command
|
||||
network->SendConnector( command );
|
||||
|
||||
// delete a command
|
||||
connectorQueue->Free( command );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user