[raknet] Update RakNetworkFactory

This commit implements:
* GetRakClientInterface()
* DestroyRakClientInterface()
* DestroyRakServerInterface()
* DestroyRakPeerInterface()
This commit is contained in:
RD42 2023-12-16 23:25:47 +08:00
parent 68cd566ffc
commit 118153f727
2 changed files with 28 additions and 6 deletions

View File

@ -1,13 +1,16 @@
// TODO: Implement RakNetworkFactory.cpp
#include "RakNetworkFactory.h"
#include "RakServerInterface.h"
#include "RakClientInterface.h"
#include "RakServer.h"
#include "RakClient.h"
#include "RakPeerInterface.h"
#include "RakPeer.h"
RakClientInterface* RakNetworkFactory::GetRakClientInterface( void )
{
return new RakClient;
}
RakServerInterface* RakNetworkFactory::GetRakServerInterface( void )
{
return new RakServer;
@ -16,3 +19,19 @@ RakPeerInterface* RakNetworkFactory::GetRakPeerInterface( void )
{
return new RakPeer;
}
void RakNetworkFactory::DestroyRakClientInterface( RakClientInterface* i )
{
delete ( RakClient* ) i;
}
void RakNetworkFactory::DestroyRakServerInterface( RakServerInterface* i )
{
delete ( RakServer* ) i;
}
void RakNetworkFactory::DestroyRakPeerInterface( RakPeerInterface* i )
{
delete ( RakPeer* ) i;
}

View File

@ -1,11 +1,10 @@
// TODO: Implement RakNetworkFactory.h
#ifndef __RAK_NETWORK_FACTORY_H
#define __RAK_NETWORK_FACTORY_H
#include "Export.h"
class RakClientInterface;
class RakServerInterface;
class RakPeerInterface;
@ -13,9 +12,13 @@ class RAK_DLL_EXPORT RakNetworkFactory
{
public:
static RakClientInterface* GetRakClientInterface( void );
static RakServerInterface* GetRakServerInterface( void );
static RakPeerInterface* GetRakPeerInterface( void );
static void DestroyRakClientInterface( RakClientInterface* i );
static void DestroyRakServerInterface( RakServerInterface* i );
static void DestroyRakPeerInterface( RakPeerInterface* i );
};
#endif