TUIO C++ Developer API
TUIO::TuioClient Class Reference

#include <TuioClient.h>

Inheritance diagram for TUIO::TuioClient:
TUIO::TuioDispatcher

Public Member Functions

 TuioClient ()
 
 TuioClient (int port)
 
 TuioClient (OscReceiver *oscreceiver)
 
 ~TuioClient ()
 
void connect (bool lock=false)
 
void disconnect ()
 
bool isConnected ()
 
std::list< TuioObject * > getTuioObjects ()
 
std::list< TuioObject * > getTuioObjects (int source_id)
 
std::list< TuioObjectcopyTuioObjects (int source_id)
 
std::list< TuioObjectcopyTuioObjects ()
 
TuioObjectgetTuioObject (long s_id)
 
TuioObjectgetTuioObject (int src_id, long s_id)
 
std::list< TuioCursor * > getTuioCursors ()
 
std::list< TuioCursor * > getTuioCursors (int source_id)
 
std::list< TuioCursorcopyTuioCursors ()
 
std::list< TuioCursorcopyTuioCursors (int source_id)
 
TuioCursorgetTuioCursor (long s_id)
 
TuioCursorgetTuioCursor (int src_id, long s_id)
 
std::list< TuioBlob * > getTuioBlobs ()
 
std::list< TuioBlob * > getTuioBlobs (int source_id)
 
std::list< TuioBlobcopyTuioBlobs ()
 
std::list< TuioBlobcopyTuioBlobs (int source_id)
 
TuioBlobgetTuioBlob (long s_id)
 
TuioBlobgetTuioBlob (int src_id, long s_id)
 
void processOSC (const osc::ReceivedMessage &message)
 
- Public Member Functions inherited from TUIO::TuioDispatcher
 TuioDispatcher ()
 
 ~TuioDispatcher ()
 
void addTuioListener (TuioListener *listener)
 
void removeTuioListener (TuioListener *listener)
 
void removeAllTuioListeners ()
 
std::list< TuioObject * > getTuioObjects ()
 
std::list< TuioObjectcopyTuioObjects ()
 
std::list< TuioCursor * > getTuioCursors ()
 
std::list< TuioCursorcopyTuioCursors ()
 
std::list< TuioBlob * > getTuioBlobs ()
 
std::list< TuioBlobcopyTuioBlobs ()
 
TuioObjectgetTuioObject (long s_id)
 
TuioCursorgetTuioCursor (long s_id)
 
TuioBlobgetTuioBlob (long s_id)
 
void lockObjectList ()
 
void unlockObjectList ()
 
void lockCursorList ()
 
void unlockCursorList ()
 
void lockBlobList ()
 
void unlockBlobList ()
 

Additional Inherited Members

- Protected Attributes inherited from TUIO::TuioDispatcher
std::list< TuioListener * > listenerList
 
std::list< TuioObject * > objectList
 
std::list< TuioCursor * > cursorList
 
std::list< TuioBlob * > blobList
 
pthread_mutex_t objectMutex
 
pthread_mutex_t cursorMutex
 
pthread_mutex_t blobMutex
 

Detailed Description

The TuioClient class is the central TUIO protocol decoder component. It provides a simple callback infrastructure using the TuioListener interface. In order to receive and decode TUIO messages an instance of TuioClient needs to be created. The TuioClient instance then generates TUIO events which are broadcasted to all registered classes that implement the TuioListener interface.

TuioClient *client = new TuioClient();
client->addTuioListener(myTuioListener);
client->connect();

Author
Martin Kaltenbrunner
Version
1.1.6

Constructor & Destructor Documentation

◆ TuioClient() [1/3]

TuioClient::TuioClient ( )

This constructor creates a TuioClient that uses an internal UdpReceiver listening to the default UDP port 3333

◆ TuioClient() [2/3]

TuioClient::TuioClient ( int  port)

This constructor creates a TuioClient that uses an internal UdpReceiver listening to the provided UDP port

Parameters
portthe UDP port the internal UdpReceiver is listening to

◆ TuioClient() [3/3]

TuioClient::TuioClient ( OscReceiver oscreceiver)

This constructor creates a TuioClient that uses the provided OscReceiver for the incoming OSC data

Parameters
oscreceiverthe OscReceiver implementation for the chosen transport method (UDP, TCP ...)

◆ ~TuioClient()

TuioClient::~TuioClient ( )

The destructor is doing nothing in particular.

Member Function Documentation

◆ connect()

void TuioClient::connect ( bool  lock = false)

The TuioClient connects and starts receiving TUIO messages from its associated OscReceiver

Parameters
lockrunning in the background if set to false (default)

◆ copyTuioBlobs() [1/2]

std::list<TuioBlob> TUIO::TuioClient::copyTuioBlobs ( )
inline

Returns a List with a copy of all currently active TuioBlobs

Returns
a List with a copy of TuioBlobs

◆ copyTuioBlobs() [2/2]

std::list< TuioBlob > TuioClient::copyTuioBlobs ( int  source_id)

Returns a List with a copy of all currently active TuioBlobs which are associated to the given Source ID

Parameters
src_idthe source ID of the corresponding TUIO source
Returns
a List with a copy of TuioBlobs

◆ copyTuioCursors() [1/2]

std::list<TuioCursor> TUIO::TuioClient::copyTuioCursors ( )
inline

Returns a List with a copy of all currently active TuioCursors

Returns
a List with a copy of TuioCursors

◆ copyTuioCursors() [2/2]

std::list< TuioCursor > TuioClient::copyTuioCursors ( int  source_id)

Returns a List with a copy of all currently active TuioCursors which are associated to the given Source ID

Parameters
src_idthe source ID of the corresponding TUIO source
Returns
a List with a copy of TuioCursors

◆ copyTuioObjects() [1/2]

std::list< TuioObject > TuioClient::copyTuioObjects ( int  source_id)

Returns a List with a copy of all currently active TuioObjects which are associated to the given Source ID

Parameters
src_idthe source ID of the corresponding TUIO source
Returns
a List with a copy of TuioObjects

◆ copyTuioObjects() [2/2]

std::list<TuioObject> TUIO::TuioClient::copyTuioObjects ( )
inline

Returns a List with a copy of all currently active TuioObjects

Returns
a List with a copy of TuioObjects

◆ disconnect()

void TuioClient::disconnect ( )

The TuioClient disconnects and stops receiving TUIO messages from its associated OscReceiver

◆ getTuioBlob() [1/2]

TuioBlob* TUIO::TuioClient::getTuioBlob ( long  s_id)
inline

Returns the TuioBlob corresponding to the provided Session ID or NULL if the Session ID does not refer to an active TuioBlob

Parameters
s_idthe session ID of the corresponding TuioBlob
Returns
an active TuioBlob corresponding to the provided Session ID or NULL

◆ getTuioBlob() [2/2]

TuioBlob * TuioClient::getTuioBlob ( int  src_id,
long  s_id 
)

Returns the TuioBlob corresponding to the provided Session ID which is associated to the given Source ID or NULL if the Session ID does not refer to an active TuioBlob

Parameters
src_idthe source ID of the corresponding TUIO source
s_idthe session ID of the corresponding TuioBlob
Returns
an active TuioBlob corresponding to the provided Session ID or NULL

◆ getTuioBlobs() [1/2]

std::list<TuioBlob*> TUIO::TuioClient::getTuioBlobs ( )
inline

Returns a List of all currently active TuioBlobs

Returns
a List of TuioBlobs

◆ getTuioBlobs() [2/2]

std::list< TuioBlob * > TuioClient::getTuioBlobs ( int  source_id)

Returns a List of all currently active TuioBlobs which are associated to the given Source ID

Parameters
src_idthe source ID of the corresponding TUIO source
Returns
a List of TuioBlobs

◆ getTuioCursor() [1/2]

TuioCursor* TUIO::TuioClient::getTuioCursor ( long  s_id)
inline

Returns the TuioCursor corresponding to the provided Session ID or NULL if the Session ID does not refer to an active TuioCursor

Parameters
s_idthe session ID of the corresponding TuioCursor
Returns
an active TuioCursor corresponding to the provided Session ID or NULL

◆ getTuioCursor() [2/2]

TuioCursor * TuioClient::getTuioCursor ( int  src_id,
long  s_id 
)

Returns the TuioCursor corresponding to the provided Session ID which is associated to the given Source ID or NULL if the Session ID does not refer to an active TuioCursor

Parameters
src_idthe source ID of the corresponding TUIO source
s_idthe session ID of the corresponding TuioCursor
Returns
an active TuioCursor corresponding to the provided Session ID or NULL

◆ getTuioCursors() [1/2]

std::list<TuioCursor*> TUIO::TuioClient::getTuioCursors ( )
inline

Returns a List of all currently active TuioCursors

Returns
a List of TuioCursors

◆ getTuioCursors() [2/2]

std::list< TuioCursor * > TuioClient::getTuioCursors ( int  source_id)

Returns a List of all currently active TuioCursors which are associated to the given Source ID

Parameters
src_idthe source ID of the corresponding TUIO source
Returns
a List of TuioCursors

◆ getTuioObject() [1/2]

TuioObject* TUIO::TuioClient::getTuioObject ( long  s_id)
inline

Returns the TuioObject corresponding to the provided Session ID or NULL if the Session ID does not refer to an active TuioObject

Parameters
s_idthe session ID of the corresponding TuioObject
Returns
an active TuioObject corresponding to the provided Session ID or NULL

◆ getTuioObject() [2/2]

TuioObject * TuioClient::getTuioObject ( int  src_id,
long  s_id 
)

Returns the TuioObject corresponding to the provided Session ID which is associated to the given Source ID or NULL if the Session ID does not refer to an active TuioObject

Parameters
src_idthe source ID of the corresponding TUIO source
s_idthe session ID of the corresponding TuioObject
Returns
an active TuioObject corresponding to the provided Session ID or NULL

◆ getTuioObjects() [1/2]

std::list<TuioObject*> TUIO::TuioClient::getTuioObjects ( )
inline

Returns a List of all currently active TuioObjects

Returns
a List of TuioObjects

◆ getTuioObjects() [2/2]

std::list< TuioObject * > TuioClient::getTuioObjects ( int  source_id)

Returns a List of all currently active TuioObjects which are associated to the given Source ID

Parameters
src_idthe source ID of the corresponding TUIO source
Returns
a List of TuioObjects

◆ isConnected()

bool TuioClient::isConnected ( )

Returns true if this TuioClient is currently connected.

Returns
true if this TuioClient is currently connected

The documentation for this class was generated from the following files: