Commit 6f46689c authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Progress

parent d1d8e436
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <VANetDefinitions.h> #include <VANetDefinitions.h>
#include <VABaseDefinitions.h>
#include <VABase.h> #include <VABase.h>
#include <VASamples.h> #include <VASamples.h>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <VANetDefinitions.h> #include <VANetDefinitions.h>
#include <string> #include <string>
class IVACore; class IVAInterface;
class CVANetNetworkProtocol; class CVANetNetworkProtocol;
/** /**
...@@ -75,7 +75,7 @@ public: ...@@ -75,7 +75,7 @@ public:
virtual ~IVANetClient(); virtual ~IVANetClient();
// Client-seitige VACore-Instanz zurckgeben // Client-seitige VACore-Instanz zurckgeben
virtual IVACore* GetCoreInstance() const = 0; virtual IVAInterface* GetCoreInstance() const = 0;
// Gibt zurck, ob eine Verbindung zu einem Server besteht // Gibt zurck, ob eine Verbindung zu einem Server besteht
virtual bool IsConnected() const = 0; virtual bool IsConnected() const = 0;
...@@ -86,9 +86,9 @@ public: ...@@ -86,9 +86,9 @@ public:
// Client initialisieren und mit einem Server verbinden // Client initialisieren und mit einem Server verbinden
// (Rckgabe: Statuscode) // (Rckgabe: Statuscode)
virtual int Initialize( const std::string& sServerAddress, int iServerPort = VANET_DEFAULT_PORT, int iHeadChannelMode = VA_HC_USE_EXISTING, int IExceptionHandlingMode = EXC_CLIENT_THROW, bool bBufferSynchronizedCommands = true ) = 0; virtual int Initialize( const std::string& sServerAddress, const int iServerPort = VANET_DEFAULT_PORT, const int iHeadChannelMode = VA_HC_USE_EXISTING, const int IExceptionHandlingMode = EXC_CLIENT_THROW, const bool bBufferSynchronizedCommands = true ) = 0;
virtual void SetExceptionHandlingMode( int nMode ) = 0; virtual void SetExceptionHandlingMode( const int nMode ) = 0;
virtual int GetExceptionhandlingMode() const = 0; virtual int GetExceptionhandlingMode() const = 0;
// Vorhandene Serververbindung beenden // Vorhandene Serververbindung beenden
...@@ -105,8 +105,8 @@ public: ...@@ -105,8 +105,8 @@ public:
EVENT_SERVER_LOST // Ungewollter Verbindungsabbruch EVENT_SERVER_LOST // Ungewollter Verbindungsabbruch
}; };
int iType; // Typ der Ereignisses
std::string sServer; // std::string sServer; //
int iType;
inline CEvent() inline CEvent()
: iType( EVENT_NOTHING ) : iType( EVENT_NOTHING )
......
This diff is collapsed.
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
class VistaConnectionIP; class VistaConnectionIP;
class CVANetNetworkProtocol; class CVANetNetworkProtocol;
class IVACoreEventHandler; class IVAEventHandler;
class VistaMutex; class VistaMutex;
/** /**
...@@ -33,30 +33,30 @@ public: ...@@ -33,30 +33,30 @@ public:
CVANetClientImpl(); CVANetClientImpl();
~CVANetClientImpl(); ~CVANetClientImpl();
IVACore* GetCoreInstance() const; IVAInterface* GetCoreInstance() const;
bool IsConnected() const; bool IsConnected() const;
std::string GetServerAddress() const; std::string GetServerAddress() const;
int Initialize( const std::string& sServerAddress, int iServerPort, int iHeadChannelMode = VA_HC_USE_EXISTING, int IExceptionHandlingMode = EXC_CLIENT_THROW, bool bBufferSynchronizedCommands = true ); int Initialize( const std::string& sServerAddress, const int iServerPort, const int iHeadChannelMode = VA_HC_USE_EXISTING, const int IExceptionHandlingMode = EXC_CLIENT_THROW, const bool bBufferSynchronizedCommands = true );
int Disconnect(); int Disconnect();
void SendConnectionEvent( int nId ); void SendConnectionEvent( int nId );
void AttachCoreEventHandler(IVACoreEventHandler* pCoreEventHandler); void AttachCoreEventHandler( IVAEventHandler* pCoreEventHandler );
void DetachCoreEventHandler(IVACoreEventHandler* pCoreEventHandler); void DetachCoreEventHandler( IVAEventHandler* pCoreEventHandler );
virtual bool AttachEventHandler(IVANetClient::IEventHandler* pHandler); virtual bool AttachEventHandler( IVANetClient::IEventHandler* pHandler );
virtual bool DetachEventHandler(IVANetClient::IEventHandler* pHandler); virtual bool DetachEventHandler( IVANetClient::IEventHandler* pHandler );
virtual void SetExceptionHandlingMode( int nMode ); virtual void SetExceptionHandlingMode( const int nMode );
virtual int GetExceptionhandlingMode() const; virtual int GetExceptionhandlingMode() const;
void ProcessNetEvent( int iEventID ); void ProcessNetEvent( int iEventID );
void ProcessEventChannelError(); void ProcessEventChannelError();
private: private:
void Cleanup(); void Cleanup();
void EmitEvent( const CEvent& oEvent ); void EmitEvent( const CEvent& oEvent );
void EmitEvent( int iID ); void EmitEvent( const int iID );
protected: protected:
class CNetworkedVACore; class CNetworkedVACore;
......
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
#include "VANetNetworkProtocol.h" #include "VANetNetworkProtocol.h"
#include <VACoreEvent.h>
#include <VAException.h>
#include <VACoreVersion.h>
#include <VistaInterProcComm/Connections/VistaConnectionIP.h> #include <VistaInterProcComm/Connections/VistaConnectionIP.h>
#include <VistaBase/VistaExceptionBase.h> #include <VistaBase/VistaExceptionBase.h>
#include <VistaBase/VistaStreamUtils.h> #include <VistaBase/VistaStreamUtils.h>
...@@ -28,7 +24,7 @@ ...@@ -28,7 +24,7 @@
static int S_nMessageIds = 0; static int S_nMessageIds = 0;
CVANetMessage::CVANetMessage( VistaSerializingToolset::ByteOrderSwapBehavior bSwapBuffers ) CVANetMessage::CVANetMessage( const VistaSerializingToolset::ByteOrderSwapBehavior bSwapBuffers )
: m_vecIncomingBuffer( 2048 ) : m_vecIncomingBuffer( 2048 )
, m_oOutgoing( 2048 ) , m_oOutgoing( 2048 )
, m_pConnection( NULL ) , m_pConnection( NULL )
...@@ -145,7 +141,7 @@ void CVANetMessage::ReadMessage() ...@@ -145,7 +141,7 @@ void CVANetMessage::ReadMessage()
iBytesRead = m_pConnection->ReadRawBuffer( &m_vecIncomingBuffer[ iBytesReadTotal ], nMessageSize - iBytesReadTotal ); // read residual bytes iBytesRead = m_pConnection->ReadRawBuffer( &m_vecIncomingBuffer[ iBytesReadTotal ], nMessageSize - iBytesReadTotal ); // read residual bytes
else else
iBytesRead = m_pConnection->ReadRawBuffer( &m_vecIncomingBuffer[ iBytesReadTotal ], iIncommingBytes ); // read all incoming bytes iBytesRead = m_pConnection->ReadRawBuffer( &m_vecIncomingBuffer[ iBytesReadTotal ], iIncommingBytes ); // read all incoming bytes
iBytesReadTotal += iBytesRead; iBytesReadTotal += iBytesRead;
} }
assert( iBytesReadTotal == nMessageSize ); assert( iBytesReadTotal == nMessageSize );
...@@ -335,11 +331,12 @@ void CVANetMessage::WriteVec3( const VAVec3& oVec ) ...@@ -335,11 +331,12 @@ void CVANetMessage::WriteVec3( const VAVec3& oVec )
WriteDouble( oVec.z ); WriteDouble( oVec.z );
} }
void CVANetMessage::WriteOrient( const VAOrientYPR& oOrient ) void CVANetMessage::WriteQuat( const VAQuat& qOrient )
{ {
WriteDouble( oOrient.yaw ); WriteDouble( qOrient.x );
WriteDouble( oOrient.pitch ); WriteDouble( qOrient.y );
WriteDouble( oOrient.roll ); WriteDouble( qOrient.z );
WriteDouble( qOrient.w );
} }
std::string CVANetMessage::ReadString() std::string CVANetMessage::ReadString()
...@@ -406,15 +403,16 @@ VAVec3 CVANetMessage::ReadVec3() ...@@ -406,15 +403,16 @@ VAVec3 CVANetMessage::ReadVec3()
return VAVec3( x, y, z ); return VAVec3( x, y, z );
} }
VAOrientYPR CVANetMessage::ReadOrient() VAQuat CVANetMessage::ReadQuat()
{ {
double yaw = ReadDouble(); double x = ReadDouble();
double pitch = ReadDouble(); double y = ReadDouble();
double roll = ReadDouble(); double z = ReadDouble();
return VAOrientYPR( yaw, pitch, roll ); double w = ReadDouble();
return VAQuat( x, y, z, w );
} }
void CVANetMessage::WriteCoreEvent( const CVACoreEvent& oEvent ) void CVANetMessage::WriteEvent( const CVAEvent& oEvent )
{ {
WriteInt( oEvent.iEventID ); WriteInt( oEvent.iEventID );
WriteUInt64( oEvent.iEventType ); WriteUInt64( oEvent.iEventType );
...@@ -432,8 +430,7 @@ void CVANetMessage::WriteCoreEvent( const CVACoreEvent& oEvent ) ...@@ -432,8 +430,7 @@ void CVANetMessage::WriteCoreEvent( const CVACoreEvent& oEvent )
WriteVec3( oEvent.vPos ); WriteVec3( oEvent.vPos );
WriteVec3( oEvent.vView ); WriteVec3( oEvent.vView );
WriteVec3( oEvent.vUp ); WriteVec3( oEvent.vUp );
WriteOrient( oEvent.oOrientation ); WriteQuat( oEvent.oOrientation );
WriteVec3( oEvent.vVelocity );
WriteInt( ( int ) oEvent.vfInputPeaks.size() ); WriteInt( ( int ) oEvent.vfInputPeaks.size() );
for( size_t i = 0; i < oEvent.vfInputPeaks.size(); i++ ) for( size_t i = 0; i < oEvent.vfInputPeaks.size(); i++ )
...@@ -447,9 +444,9 @@ void CVANetMessage::WriteCoreEvent( const CVACoreEvent& oEvent ) ...@@ -447,9 +444,9 @@ void CVANetMessage::WriteCoreEvent( const CVACoreEvent& oEvent )
WriteDouble( oEvent.dCoreClock ); WriteDouble( oEvent.dCoreClock );
} }
CVACoreEvent CVANetMessage::ReadCoreEvent() CVAEvent CVANetMessage::ReadEvent()
{ {
CVACoreEvent oEvent; CVAEvent oEvent;
oEvent.iEventID = ReadInt(); oEvent.iEventID = ReadInt();
oEvent.iEventType = ReadUInt64(); oEvent.iEventType = ReadUInt64();
oEvent.iObjectID = ReadInt(); oEvent.iObjectID = ReadInt();
...@@ -466,8 +463,7 @@ CVACoreEvent CVANetMessage::ReadCoreEvent() ...@@ -466,8 +463,7 @@ CVACoreEvent CVANetMessage::ReadCoreEvent()
oEvent.vPos = ReadVec3(); oEvent.vPos = ReadVec3();
oEvent.vView = ReadVec3(); oEvent.vView = ReadVec3();
oEvent.vUp = ReadVec3(); oEvent.vUp = ReadVec3();
oEvent.oOrientation = ReadOrient(); oEvent.oOrientation = ReadQuat();
oEvent.vVelocity = ReadVec3();
int n = ReadInt(); int n = ReadInt();
for( int i = 0; i < n; i++ ) for( int i = 0; i < n; i++ )
...@@ -498,7 +494,7 @@ CVAException CVANetMessage::ReadException() ...@@ -498,7 +494,7 @@ CVAException CVANetMessage::ReadException()
return CVAException( nType, ReadString() ); return CVAException( nType, ReadString() );
} }
void CVANetMessage::WriteCoreVersionInfo( const CVACoreVersionInfo& oInfo ) void CVANetMessage::WriteVersionInfo( const CVAVersionInfo& oInfo )
{ {
WriteString( oInfo.sVersion ); WriteString( oInfo.sVersion );
WriteString( oInfo.sFlags ); WriteString( oInfo.sFlags );
...@@ -506,9 +502,9 @@ void CVANetMessage::WriteCoreVersionInfo( const CVACoreVersionInfo& oInfo ) ...@@ -506,9 +502,9 @@ void CVANetMessage::WriteCoreVersionInfo( const CVACoreVersionInfo& oInfo )
WriteString( oInfo.sComments ); WriteString( oInfo.sComments );
} }
CVACoreVersionInfo CVANetMessage::ReadCoreVersionInfo() CVAVersionInfo CVANetMessage::ReadVersionInfo()
{ {
CVACoreVersionInfo oInfo; CVAVersionInfo oInfo;
oInfo.sVersion = ReadString(); oInfo.sVersion = ReadString();
oInfo.sFlags = ReadString(); oInfo.sFlags = ReadString();
oInfo.sDate = ReadString(); oInfo.sDate = ReadString();
...@@ -519,7 +515,6 @@ CVACoreVersionInfo CVANetMessage::ReadCoreVersionInfo() ...@@ -519,7 +515,6 @@ CVACoreVersionInfo CVANetMessage::ReadCoreVersionInfo()
void CVANetMessage::WriteDirectivityInfo( const CVADirectivityInfo& oInfo ) void CVANetMessage::WriteDirectivityInfo( const CVADirectivityInfo& oInfo )
{ {
WriteString( oInfo.sName ); WriteString( oInfo.sName );
WriteString( oInfo.sFilename );
WriteInt( oInfo.iID ); WriteInt( oInfo.iID );
WriteInt( oInfo.iReferences ); WriteInt( oInfo.iReferences );
WriteString( oInfo.sDesc ); WriteString( oInfo.sDesc );
...@@ -529,57 +524,15 @@ CVADirectivityInfo CVANetMessage::ReadDirectivityInfo() ...@@ -529,57 +524,15 @@ CVADirectivityInfo CVANetMessage::ReadDirectivityInfo()
{ {
CVADirectivityInfo oInfo; CVADirectivityInfo oInfo;
oInfo.sName = ReadString(); oInfo.sName = ReadString();
oInfo.sFilename = ReadString();
oInfo.iID = ReadInt(); oInfo.iID = ReadInt();
oInfo.iReferences = ReadInt(); oInfo.iReferences = ReadInt();
oInfo.sDesc = ReadString(); oInfo.sDesc = ReadString();
return oInfo; return oInfo;
} }
void CVANetMessage::WriteHRIRInfo( const CVAHRIRInfo& oInfo )
{
WriteString( oInfo.sName );
WriteString( oInfo.sFilename );
WriteInt( oInfo.iID );
WriteInt( oInfo.iReferences );
WriteString( oInfo.sDesc );
}
CVAHRIRInfo CVANetMessage::ReadHRIRInfo()
{
CVAHRIRInfo oInfo;
oInfo.sName = ReadString();
oInfo.sFilename = ReadString();
oInfo.iID = ReadInt();
oInfo.iReferences = ReadInt();
oInfo.sDesc = ReadString();
return oInfo;
}
void CVANetMessage::WriteSoundInfo( const CVASoundInfo& oInfo )
{
WriteString( oInfo.sName );
WriteString( oInfo.sFilename );
WriteInt( oInfo.iLength );
WriteInt( oInfo.iID );
WriteDouble( oInfo.dDuration );
}
CVASoundInfo CVANetMessage::ReadSoundInfo()
{
CVASoundInfo oInfo;
oInfo.sName = ReadString();
oInfo.sFilename = ReadString();
oInfo.iLength = ReadInt();
oInfo.iID = ReadInt();
oInfo.dDuration = ReadDouble();
return oInfo;
}
void CVANetMessage::WriteSignalSourceInfo( const CVASignalSourceInfo& oInfo ) void CVANetMessage::WriteSignalSourceInfo( const CVASignalSourceInfo& oInfo )
{ {
WriteString( oInfo.sName ); WriteString( oInfo.sName );
WriteString( oInfo.sType );
WriteString( oInfo.sState ); WriteString( oInfo.sState );
WriteString( oInfo.sID ); WriteString( oInfo.sID );
WriteString( oInfo.sDesc ); WriteString( oInfo.sDesc );
...@@ -590,7 +543,6 @@ CVASignalSourceInfo CVANetMessage::ReadSignalSourceInfo() ...@@ -590,7 +543,6 @@ CVASignalSourceInfo CVANetMessage::ReadSignalSourceInfo()
{ {
CVASignalSourceInfo oInfo; CVASignalSourceInfo oInfo;
oInfo.sName = ReadString(); oInfo.sName = ReadString();
oInfo.sType = ReadString();
oInfo.sState = ReadString(); oInfo.sState = ReadString();
oInfo.sID = ReadString(); oInfo.sID = ReadString();
oInfo.sDesc = ReadString(); oInfo.sDesc = ReadString();
...@@ -686,7 +638,7 @@ void CVANetMessage::WriteVAStruct( const CVAStruct& oStruct ) ...@@ -686,7 +638,7 @@ void CVANetMessage::WriteVAStruct( const CVAStruct& oStruct )
for( int i = 0; i < oSampleBuffer.GetNumSamples(); i++ ) for( int i = 0; i < oSampleBuffer.GetNumSamples(); i++ )
WriteFloat( oSampleBuffer.vfSamples[ i ] ); WriteFloat( oSampleBuffer.vfSamples[ i ] );
} }
break; break;
default: default:
// Implementierung vergessen? Oder neuer Datentyp? // Implementierung vergessen? Oder neuer Datentyp?
...@@ -738,7 +690,7 @@ void CVANetMessage::ReadVAStruct( CVAStruct& oStruct ) ...@@ -738,7 +690,7 @@ void CVANetMessage::ReadVAStruct( CVAStruct& oStruct )
ReadVAStruct( oSubstruct ); ReadVAStruct( oSubstruct );
oStruct[ sKeyName ] = oSubstruct; oStruct[ sKeyName ] = oSubstruct;
} }
break; break;
case CVAStructValue::DATA: case CVAStructValue::DATA:
{ {
...@@ -755,7 +707,7 @@ void CVANetMessage::ReadVAStruct( CVAStruct& oStruct ) ...@@ -755,7 +707,7 @@ void CVANetMessage::ReadVAStruct( CVAStruct& oStruct )
} }
oStruct[ sKeyName ] = CVAStructValue( pData, iDataSize ); oStruct[ sKeyName ] = CVAStructValue( pData, iDataSize );
} }
break; break;
case CVAStructValue::SAMPLEBUFFER: case CVAStructValue::SAMPLEBUFFER:
{ {
...@@ -765,7 +717,7 @@ void CVANetMessage::ReadVAStruct( CVAStruct& oStruct ) ...@@ -765,7 +717,7 @@ void CVANetMessage::ReadVAStruct( CVAStruct& oStruct )
for( int i = 0; i < iNumSamples; i++ ) for( int i = 0; i < iNumSamples; i++ )
oSampleBuffer.vfSamples[ i ] = ReadFloat(); oSampleBuffer.vfSamples[ i ] = ReadFloat();
} }
break; break;
default: default:
// Implementierung vergessen? Oder neuer Datentyp? // Implementierung vergessen? Oder neuer Datentyp?
......
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
#ifndef IW_VANET_MESSAGE #ifndef IW_VANET_MESSAGE
#define IW_VANET_MESSAGE #define IW_VANET_MESSAGE
#include <VABaseDefinitions.h> #include <VA.h>
#include <VABase.h>
#include <VAStruct.h>
#include "VANetVistaCompatibility.h" #include "VANetVistaCompatibility.h"
...@@ -29,12 +27,10 @@ ...@@ -29,12 +27,10 @@
class VistaConnectionIP; class VistaConnectionIP;
class CVACoreEvent; class CVAEvent;
class CVAException; class CVAException;
class CVACoreVersionInfo; class CVAVersionInfo;
class CVADirectivityInfo; class CVADirectivityInfo;
class CVAHRIRInfo;
class CVASoundInfo;
class CVASignalSourceInfo; class CVASignalSourceInfo;
class CVASceneInfo; class CVASceneInfo;
...@@ -46,7 +42,7 @@ class CVASceneInfo; ...@@ -46,7 +42,7 @@ class CVASceneInfo;
class CVANetMessage class CVANetMessage
{ {
public: public:
explicit CVANetMessage( VistaSerializingToolset::ByteOrderSwapBehavior bSwapBuffers ); explicit CVANetMessage( const VistaSerializingToolset::ByteOrderSwapBehavior bSwapBuffers );
void ResetMessage(); void ResetMessage();
...@@ -61,9 +57,9 @@ public: ...@@ -61,9 +57,9 @@ public:
int GetMessageType() const; int GetMessageType() const;
int GetAnswerType() const; int GetAnswerType() const;
void SetExceptionMode( int nMode ); void SetExceptionMode( const int nMode );
void SetMessageType( int nType ); void SetMessageType( const int nType );
void SetAnswerType( int nType ); void SetAnswerType( const int nType );
int GetIncomingMessageSize() const; int GetIncomingMessageSize() const;
int GetOutgoingMessageSize() const; int GetOutgoingMessageSize() const;
...@@ -79,13 +75,11 @@ public: ...@@ -79,13 +75,11 @@ public:
void WriteFloat( const float fValue ); void WriteFloat( const float fValue );
void WriteDouble( const double fValue ); void WriteDouble( const double fValue );
void WriteVec3( const VAVec3& oVec ); void WriteVec3( const VAVec3& oVec );
void WriteOrient( const VAOrientYPR& oOrient ); void WriteQuat( const VAQuat& qOrient );
void WriteException( const CVAException& oException ); void WriteException( const CVAException& oException );
void WriteCoreEvent( const CVACoreEvent& oEvent ); void WriteEvent( const CVAEvent& oEvent );
void WriteCoreVersionInfo( const CVACoreVersionInfo& oInfo ); void WriteVersionInfo( const CVAVersionInfo& oInfo );
void WriteDirectivityInfo( const CVADirectivityInfo& oInfo ); void WriteDirectivityInfo( const CVADirectivityInfo& oInfo );
void WriteHRIRInfo( const CVAHRIRInfo& oInfo );
void WriteSoundInfo( const CVASoundInfo& oInfo );
void WriteSignalSourceInfo( const CVASignalSourceInfo& oInfo ); void WriteSignalSourceInfo( const CVASignalSourceInfo& oInfo );
void WriteSceneInfo( const CVASceneInfo& oInfo ); void WriteSceneInfo( const CVASceneInfo& oInfo );
void WriteModuleInfo( const CVAModuleInfo& oInfo ); void WriteModuleInfo( const CVAModuleInfo& oInfo );
...@@ -101,13 +95,11 @@ public: ...@@ -101,13 +95,11 @@ public:
float ReadFloat(); float ReadFloat();
double ReadDouble(); double ReadDouble();
VAVec3 ReadVec3(); VAVec3 ReadVec3();
VAOrientYPR ReadOrient(); VAQuat ReadQuat();
CVAException ReadException(); CVAException ReadException();
CVACoreEvent ReadCoreEvent(); CVAEvent ReadEvent();
CVACoreVersionInfo ReadCoreVersionInfo(); CVAVersionInfo ReadVersionInfo();
CVADirectivityInfo ReadDirectivityInfo(); CVADirectivityInfo ReadDirectivityInfo();
CVAHRIRInfo ReadHRIRInfo();
CVASoundInfo ReadSoundInfo();
CVASignalSourceInfo ReadSignalSourceInfo(); CVASignalSourceInfo ReadSignalSourceInfo();
CVASceneInfo ReadSceneInfo(); CVASceneInfo ReadSceneInfo();
void ReadModuleInfo( CVAModuleInfo& oInfo ); void ReadModuleInfo( CVAModuleInfo& oInfo );
......
This diff is collapsed.
This diff is collapsed.
...@@ -25,39 +25,33 @@ class VistaConnectionUpdater; ...@@ -25,39 +25,33 @@ class VistaConnectionUpdater;
class CVANetNetworkProtocol; class CVANetNetworkProtocol;
class VistaMutex; class VistaMutex;
class CVANetServerImpl : public IVANetServer { class CVANetServerImpl : public IVANetServer
{
public: public:
CVANetServerImpl(); CVANetServerImpl();
~CVANetServerImpl(); ~CVANetServerImpl();
int Initialize(const std::string& sInterface, int Initialize( const std::string& sInterface, const int iServerPort, const int iFreePortMin = 10000, const int iFreePortMax = 11000, const int iMaxNumClients = -1 );
int iServerPort, int Initialize( const std::string& sInterface, const int iServerPort, const tPortList& liFreePorts, const int iMaxNumClients = -1 );
int iFreePortMin=10000,
int iFreePortMax=11000,
int iMaxNumClients = -1);
int Initialize(const std::string& sInterface,
int iServerPort,
const tPortList& liFreePorts,
int iMaxNumClients = -1);
int Finalize(); int Finalize();
void Reset(); void Reset();
std::string GetServerAdress() const; std::string GetServerAdress() const;
int GetServerPort() const; int GetServerPort() const;
IVACore* GetCoreInstance() const; IVAInterface* GetCoreInstance() const;
void SetCoreInstance(IVACore* pCore); void SetCoreInstance( IVAInterface* pCore );
bool IsClientConnected() const; bool IsClientConnected() const;
int GetNumConnectedClients() const; int GetNumConnectedClients() const;
std::string GetClientHostname(const int iClientIndex) const; std::string GetClientHostname( const int iClientIndex ) const;
bool AttachEventHandler(IVANetServer::IEventHandler* pHandler); bool AttachEventHandler( IVANetServer::IEventHandler* pHandler );