Commit 8308160d authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Updating headers for 2017 and style

parent 9140f2c5
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* Datei: VANetAudiostreamReceiver.h
*
* Zweck: Receiver-side implementation of a network audio stream
*
* Autor(en): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de),
* Dominik Rausch (rausch@vr.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
// $Id: VANetAudiostreamReceiver.h 4150 2015-08-03 15:47:50Z fwefers $
#ifndef __VANET_AUDIOSTREAM_RECEIVER_H__
#define __VANET_AUDIOSTREAM_RECEIVER_H__
......@@ -31,13 +21,14 @@
class CVAAudiostreamProperties;
class CVAAudiostreamState;
//! Receiver-side implementation of a network audio stream
/**
* Sender-side implementation of a network audio stream,
* which transfers samples over TCP network to a audiostream receiver
* Sender and receiver are in an 1:1 relation.
*/
class VANET_API CVANetAudiostreamSender {
class VANET_API CVANetAudiostreamSender
{
public:
//! Rckgabewerte / Fehlerzustnde
enum {
......
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* Datei: VANetAudiostreamSender.h
*
* Zweck: Sender-side implementation of a network audio stream
*
* Autor(en): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de),
* Dominik Rausch (rausch@vr.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
// $Id: VANetAudiostreamSender.h 4150 2015-08-03 15:47:50Z fwefers $
#ifndef __VANET_AUDIOSTREAM_SENDER_H__
#define __VANET_AUDIOSTREAM_SENDER_H__
......
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* Datei: VANetClient.h
*
* Zweck: Schnittstelle des Netzwerk-Clients fr den VA-Kernel
*
* Autor(en): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de),
* Dominik Rausch (rausch@vr.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
// $Id: VANetClient.h 2732 2012-06-26 13:38:17Z fwefers $
#ifndef __VANET_CLIENT_H__
#define __VANET_CLIENT_H__
#ifndef IW_VANET_CLIENT
#define IW_VANET_CLIENT
#include <VANetDefinitions.h>
#include <string>
......@@ -47,10 +37,12 @@ class CVANetNetworkProtocol;
* - Redefinieren der Attach/DetachCoreEventHandler im Protokoll
*/
class VANET_API IVANetClient {
class VANET_API IVANetClient
{
public:
//! Rckgabewerte / Fehlerzustnde
enum {
enum
{
VA_NO_ERROR = 0, //!< Kein Fehler / Erfolgreich
VA_SERVER_CONNECTION_FAILED, //!< Verbindung zum Server fehlgeschlagen - Falsche Addresse, oder Server luft nicht
VA_SERVER_NOT_RESPONDING, //!< Verbindung zum Server wurde aufgebaut, aber keine Antwort erhalten
......@@ -61,20 +53,22 @@ public:
};
//HeadChannel Modi
enum {
enum
{
VA_HC_USE_EXISTING = 0,
VA_HC_SEPARATE_TCP,
VA_HC_SEPARATE_UDP
};
// Exception Handling Modi
enum {
enum
{
EXC_CLIENT_THROW, // for all functions, immediately transmit exception and throws it
//EXC_ASYNC_PRINT, // functions without return value immediately return,
// // and any exceptions are asynchronously transmitted to
// // the client and printed there
EXC_SERVER_PRINT, // functions without return value immediately return,
// and the exception is printed on the server
// and the exception is printed on the server
};
// Factory method
......@@ -82,33 +76,35 @@ public:
virtual ~IVANetClient();
// Client-seitige VACore-Instanz zurckgeben
virtual IVACore* GetCoreInstance() const=0;
virtual IVACore* GetCoreInstance() const = 0;
// Gibt zurck, ob eine Verbindung zu einem Server besteht
virtual bool IsConnected() const=0;
virtual bool IsConnected() const = 0;
// Gibt die Adresse des verbundenen Servers zurck
// (Rckgabe: leerer String, falls nicht verbunden)
virtual std::string GetServerAddress() const=0;
virtual std::string GetServerAddress() const = 0;
// Client initialisieren und mit einem Server verbinden
// (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, int iServerPort = VANET_DEFAULT_PORT,
int iHeadChannelMode = VA_HC_USE_EXISTING,
int IExceptionHandlingMode = EXC_CLIENT_THROW,
bool bBufferSynchronizedCommands = true ) = 0;
virtual void SetExceptionHandlingMode( int nMode ) = 0;
virtual int GetExceptionhandlingMode() const = 0;
// Vorhandene Serververbindung beenden
// (Rckgabe: Statuscode)
virtual int Disconnect()=0;
virtual int Disconnect() = 0;
class CEvent {
class CEvent
{
public:
enum {
enum
{
EVENT_NOTHING = 0,
EVENT_SERVER_DISCONNECT, // Gewollter Verbindungsabbruch
EVENT_SERVER_LOST // Ungewollter Verbindungsabbruch
......@@ -117,24 +113,30 @@ public:
int iType; // Typ der Ereignisses
std::string sServer; //
CEvent() : iType(EVENT_NOTHING) {};
inline CEvent()
: iType( EVENT_NOTHING )
{
};
CEvent(int iInitType, const std::string& sInitServer)
: iType(iInitType), sServer(sInitServer) {};
inline CEvent( int iInitType, const std::string& sInitServer )
: iType( iInitType )
, sServer( sInitServer )
{
};
};
class IEventHandler {
public:
virtual ~IEventHandler() {};
virtual void HandleEvent(const IVANetClient::CEvent& oEvent)=0;
virtual void HandleEvent( const IVANetClient::CEvent& oEvent ) = 0;
};
virtual bool AttachEventHandler(IVANetClient::IEventHandler* pHandler)=0;
virtual bool DetachEventHandler(IVANetClient::IEventHandler* pHandler)=0;
virtual bool AttachEventHandler( IVANetClient::IEventHandler* pHandler ) = 0;
virtual bool DetachEventHandler( IVANetClient::IEventHandler* pHandler ) = 0;
protected:
IVANetClient();
};
#endif // __VANET_CLIENT_H__
#endif // IW_VANET_CLIENT
......@@ -3,16 +3,16 @@
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA)
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* --------------------------------------------------------------------------------------------
*/
#ifndef VA_INCLUDE_GUARD_VANET_DEFINITIONS
#define VA_INCLUDE_GUARD_VANET_DEFINITIONS
#ifndef IW_VANET_DEFINITIONS
#define IW_VANET_DEFINITIONS
#if ( defined WIN32 ) && !( defined VANET_STATIC )
#ifdef VANET_EXPORTS
......@@ -33,4 +33,4 @@
#define VANET_DEFAULT_PORT 12340
#endif
#endif // VA_INCLUDE_GUARD_VANET_DEFINITIONS
#endif // IW_VANET_DEFINITIONS
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A Virtual Acoustics
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVV VVV AAA (c) Copyright Institute for Technical Acoustics (ITA)
* VVVVVV AAA RWTH Aachen University, Aachen Germany
* VVVV AAA (http://www.akustik.rwth-aachen.de)
* VVV VVV A
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* File: VANetServer.h
*
* Purpose: Network server interface
*
* Authors: Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de),
* Dominik Rausch (rausch@vr.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
// $Id: VANetServer.h 2732 2012-06-26 13:38:17Z fwefers $
#ifndef __VANET_SERVER_H__
#define __VANET_SERVER_H__
#ifndef IW_VANET_SERVER
#define IW_VANET_SERVER
#include <VANetDefinitions.h>
......@@ -51,12 +41,14 @@ class IVACore;
* - Der Client muss auch VACoreEvents von der Server-Seite weiterleiten. Mechanismus entwickeln + implementieren
*/
class VANET_API IVANetServer {
class VANET_API IVANetServer
{
public:
typedef std::pair<int,int> tPortRange;
typedef std::pair<int, int> tPortRange;
typedef std::list<tPortRange> tPortList;
enum {
enum
{
VA_NO_ERROR = 0,
VA_ALREADY_INITIALIZED,
VA_NOT_INITIALIZED,
......@@ -80,15 +72,15 @@ public:
* iFreePortMax Ende Portbereich fr Kommunikation mit den Clients
* iMaxNumClients Zahl der maximalen gleichzeitig verbundenen Netzwerk-Clients,
* wobei -1 fr unlimitiere Verbindungszahl steht
*
*
* Rckgabe: Statuscode
*/
// @todo: enforce setting real core in initialize call
virtual int Initialize(const std::string& sInterface,
int iServerPort=VANET_DEFAULT_PORT,
int iFreePortMin=10000,
int iFreePortMax=11000,
int iMaxNumClients = -1)=0;
virtual int Initialize( const std::string& sInterface,
int iServerPort = VANET_DEFAULT_PORT,
int iFreePortMin = 10000,
int iFreePortMax = 11000,
int iMaxNumClients = -1 ) = 0;
/**
* Server initialisieren
......@@ -98,33 +90,33 @@ public:
* liFreePorts Liste der Ports fr Kommunikation mit den Clients
* iMaxNumClients Zahl der maximalen gleichzeitig verbundenen Netzwerk-Clients,
* wobei -1 fr unlimitiere Verbindungszahl steht
*
*
* Rckgabe: Statuscode
*/
virtual int Initialize(const std::string& sInterface,
int iServerPort,
const tPortList& liFreePorts,
int iMaxNumClients = -1)=0;
virtual int Initialize( const std::string& sInterface,
int iServerPort,
const tPortList& liFreePorts,
int iMaxNumClients = -1 ) = 0;
// Vorhandene Serververbindungen trennen und Server beenden
// (Rckgabe: Statuscode)
virtual int Finalize()=0;
virtual int Finalize() = 0;
// Alle vorhandenen Verbindungen abbrechen und den Kern zurcksetzen
virtual void Reset()=0;
virtual void Reset() = 0;
// Gibt die Netzwerk-Schnittstelle des Servers zurck
virtual std::string GetServerAdress() const=0;
virtual std::string GetServerAdress() const = 0;
// Gibt den Netzwerk-Port des Servers zurck
virtual int GetServerPort() const=0;
virtual int GetServerPort() const = 0;
// Zugewiesene VACore-Instanz zurckgeben
virtual IVACore* GetCoreInstance() const=0;
virtual IVACore* GetCoreInstance() const = 0;
// Zu steuernde VACore-Instanz zuweisen
// (NULL entfernt den Kern)
virtual void SetCoreInstance(IVACore* pCore)=0;
virtual void SetCoreInstance( IVACore* pCore ) = 0;
//// Gibt zurck, ob der Server aktiviert ist
//// und eingehende Befehle an den zugewiesenen Kern weiterleitet
......@@ -136,16 +128,18 @@ public:
//virtual void SetActive(bool bActive)=0;
// Gibt zurck, ob ein Client verbunden ist
virtual bool IsClientConnected() const=0;
virtual bool IsClientConnected() const = 0;
// Gibt zurck, ob ein Client verbunden ist
virtual int GetNumConnectedClients() const=0;
virtual int GetNumConnectedClients() const = 0;
// Gibt den Namen/Host des Clients mit der entsprechenden ID
virtual std::string GetClientHostname( const int iClientIndex ) const=0;
virtual std::string GetClientHostname( const int iClientIndex ) const = 0;
class CEvent {
class CEvent
{
public:
enum {
enum
{
EVENT_NOTHING = 0,
EVENT_CLIENT_CONNECT, // Verbindungsaufbau eines Clients
EVENT_CLIENT_DISCONNECT, // Gewollter Verbindungsabbruch eines Clients
......@@ -155,25 +149,25 @@ public:
int iType; // Typ der Ereignisses
std::string sClient; //
CEvent() : iType(EVENT_NOTHING) {};
inline CEvent() : iType( EVENT_NOTHING ) {};
CEvent(int iInitType, const std::string& sInitParam)
: iType(iInitType), sClient(sInitParam) {};
inline CEvent( int iInitType, const std::string& sInitParam )
: iType( iInitType ), sClient( sInitParam ) {};
};
class IEventHandler {
public:
virtual ~IEventHandler() {};
inline virtual ~IEventHandler() {};
virtual void HandleEvent(const IVANetServer::CEvent& oEvent)=0;
virtual void HandleEvent( const IVANetServer::CEvent& oEvent ) = 0;
};
virtual bool AttachEventHandler(IVANetServer::IEventHandler* pHandler)=0;
virtual bool DetachEventHandler(IVANetServer::IEventHandler* pHandler)=0;
virtual bool AttachEventHandler( IVANetServer::IEventHandler* pHandler ) = 0;
virtual bool DetachEventHandler( IVANetServer::IEventHandler* pHandler ) = 0;
protected:
IVANetServer();
};
#endif // __VANET_SERVER_H__
#endif // IW_VANET_SERVER
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* Datei: VANetUtils.h
*
* Zweck: Hilfsfunktionen
*
* Autor(en): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
// $Id: VANetUtils.h 2732 2012-06-26 13:38:17Z fwefers $
#ifndef __VANET_UTILS_H__
#define __VANET_UTILS_H__
#ifndef IW_VANET_UTILS
#define IW_VANET_UTILS
#include <VANetDefinitions.h>
......@@ -35,4 +26,4 @@ VANET_API void SplitServerString(const std::string& sServerString,
int& iPort,
int iDefaultPort=VANET_DEFAULT_PORT);
#endif // __VANET_VERSION_H__
#endif // IW_VANET_UTILS
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* Datei: VANetVersions.h
*
* Zweck: Versionsinformationen zur VANet-Bibliothek
*
* Autor(en): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
// $Id: VANetVersion.h 2732 2012-06-26 13:38:17Z fwefers $
#ifndef __VANET_VERSION_H__
#define __VANET_VERSION_H__
#ifndef IW_VANET_VERSION
#define IW_VANET_VERSION
#include <VANetDefinitions.h>
......@@ -45,4 +36,4 @@ public:
//! Versionsnummer der VA-Net Bibliothek abrufen
void VANET_API GetVANetVersionInfo( CVANetVersionInfo* pVersionInfo );
#endif // __VANET_VERSION_H__
#endif // IW_VANET_VERSION
......@@ -223,7 +223,15 @@ void CVANetMessage::ReadAnswer()
try
{
VANetCompat::sint32 nMessageSize;
int nReturn = m_pConnection->ReadInt32( nMessageSize );
int nReturn;
try
{
nReturn = m_pConnection->ReadInt32( nMessageSize );
}
catch( ... )
{
nReturn = -1; // Network connection error
}
if( nReturn != sizeof(VANetCompat::sint32) )
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment