Virtual Acoustics (VA) C++ API  v2018a
Virtual Acoustics is a real-time auralization framework devoted to Virtual Reality.
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
IVANetClient Class Referenceabstract

Networked transparend calls to VA interface view TCP/IP as a client. More...

#include <VANetClient.h>

Inheritance diagram for IVANetClient:
CVANetClientImpl

Classes

class  CEvent
 Connection event class. More...
 
class  IEventHandler
 Interface for handling conection events using the provided hook / callback. More...
 

Public Types

enum  ErrorType {
  VA_NO_ERROR = 0, VA_SERVER_CONNECTION_FAILED, VA_SERVER_NOT_RESPONDING, VA_SERVICE_IN_USE,
  VA_CONNECTION_ERROR, VA_PROTOCOL_INCOMPATIBLE, VA_UNKNOWN_ERROR
}
 Error types. More...
 
enum  HeadChannelMode { VA_HC_USE_EXISTING = 0, VA_HC_SEPARATE_TCP, VA_HC_SEPARATE_UDP }
 Head channel modi. More...
 
enum  ExceptionHandlingMode { EXC_CLIENT_THROW, EXC_SERVER_PRINT }
 Exception handling modi. More...
 

Public Member Functions

virtual ~IVANetClient ()
 Destructor. More...
 
virtual IVAInterfaceGetCoreInstance () const =0
 Return client-side interface (networked calls) More...
 
virtual bool IsConnected () const =0
 
virtual std::string GetServerAddress () const =0
 Server address getter. More...
 
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
 Initialize client and connect server. More...
 
virtual void SetExceptionHandlingMode (const int nMode)=0
 Exception mode setter. More...
 
virtual int GetExceptionhandlingMode () const =0
 Exception mode getter. More...
 
virtual int Disconnect ()=0
 Disconnect an established connection. More...
 
virtual bool AttachEventHandler (IVANetClient::IEventHandler *pHandler)=0
 Connection event handler attachment. More...
 
virtual bool DetachEventHandler (IVANetClient::IEventHandler *pHandler)=0
 Connection event handler detachment. More...
 

Static Public Member Functions

static IVANetClientCreate ()
 Factory method. More...
 

Protected Member Functions

 IVANetClient ()
 No default construction. More...
 

Detailed Description

Networked transparend calls to VA interface view TCP/IP as a client.

This class defines an interface for network clients to IVAInterface. Almost the entire interface is replicated via network.

Create an instance using the factory method Create().

Client creates a client-side implementation of the interface on success. You can get access to the (transparently networked) interface using GetCoreInstance(). Any method call will be forwarded to the corresponding server.

Definition at line 36 of file VANetClient.h.

Member Enumeration Documentation

Error types.

Enumerator
VA_NO_ERROR 

No error / success.

VA_SERVER_CONNECTION_FAILED 

Connection faild - wrong address or no server running.

VA_SERVER_NOT_RESPONDING 

Connection established, but server is not responding.

VA_SERVICE_IN_USE 

Network service is already used by another client.

VA_CONNECTION_ERROR 

Unknown network error occurred.

VA_PROTOCOL_INCOMPATIBLE 

Incompatible network protocol versions (declined connection)

VA_UNKNOWN_ERROR 

Any other unrecognized error.

Definition at line 40 of file VANetClient.h.

Exception handling modi.

Enumerator
EXC_CLIENT_THROW 

for all functions, immediately transmit exception and throws it

EXC_SERVER_PRINT 

functions without return value immediately return, and the exception is printed on the server

Definition at line 60 of file VANetClient.h.

Head channel modi.

Enumerator
VA_HC_USE_EXISTING 
VA_HC_SEPARATE_TCP 
VA_HC_SEPARATE_UDP 

Definition at line 52 of file VANetClient.h.

Constructor & Destructor Documentation

IVANetClient::~IVANetClient ( )
virtual

Destructor.

Definition at line 26 of file VANetClient.cpp.

IVANetClient::IVANetClient ( )
protected

No default construction.

Definition at line 22 of file VANetClient.cpp.

Member Function Documentation

virtual bool IVANetClient::AttachEventHandler ( IVANetClient::IEventHandler pHandler)
pure virtual

Connection event handler attachment.

Parameters
[in]pHandlerPointer to handler instance
Returns
True, if attachment possible

Implemented in CVANetClientImpl.

IVANetClient * IVANetClient::Create ( )
static

Factory method.

Returns
Pointer to new net client

Definition at line 17 of file VANetClient.cpp.

virtual bool IVANetClient::DetachEventHandler ( IVANetClient::IEventHandler pHandler)
pure virtual

Connection event handler detachment.

Parameters
[in]pHandlerPointer to handler instance
Returns
True, if detachment possible

Implemented in CVANetClientImpl.

virtual int IVANetClient::Disconnect ( )
pure virtual

Disconnect an established connection.

Returns
Status code

Implemented in CVANetClientImpl.

virtual IVAInterface* IVANetClient::GetCoreInstance ( ) const
pure virtual

Return client-side interface (networked calls)

Returns
Interface pointerServer connection getter

Implemented in CVANetClientImpl.

virtual int IVANetClient::GetExceptionhandlingMode ( ) const
pure virtual

Exception mode getter.

Returns
Exception mode

Implemented in CVANetClientImpl.

virtual std::string IVANetClient::GetServerAddress ( ) const
pure virtual

Server address getter.

Returns
Server address string

Implemented in CVANetClientImpl.

virtual int IVANetClient::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 
)
pure virtual

Initialize client and connect server.

Parameters
[in]sServerAddressServer address string
[in]iServerPortServer port (defaults to VANet definition)
[in]iHeadChannelModeServer port (defaults to VANet definition)
[in]iExceptionHandlingModeDefine exception mode handling
[in]bBufferSynchronizedCommandsBuffer synchronized commands on client side
Returns
Status code

Implemented in CVANetClientImpl.

virtual bool IVANetClient::IsConnected ( ) const
pure virtual
Returns
True, if connection is established

Implemented in CVANetClientImpl.

virtual void IVANetClient::SetExceptionHandlingMode ( const int  nMode)
pure virtual

Exception mode setter.

Parameters
[in]nModeException mode

Implemented in CVANetClientImpl.


The documentation for this class was generated from the following files:
Virtual Acoustics (VA) | http://www.virtualacoustics.org
Source code licensed under the Apache License, Version 2.0
C++ API documentation auto generated and licensed under Creative Commons Attribution License 4.0
© 2017-2018 Institute of Technical Acoustics (ITA)
RWTH Aachen University, Germany.