SPAOP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions
lowrappers Namespace Reference

A namespace for C++ wrappers for the Liblo library. More...

Classes

class  Address
 A wrapper for Liblo's lo_address. More...
 
class  GenericServerThreadListener
 A generic functor class for the ServerThread::Listener interface. More...
 
class  Message
 A wrapper of Liblo's lo_message. More...
 
class  ServerThread
 A server thread with Liblo-style callback capabilities. More...
 

Functions

template<class T >
ServerThread::ListenerListenerMaker (T &object, int(T::*fp)(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg))
 A function that conveniently wraps up a GenericServerThreadListener. More...
 

Detailed Description

A namespace for C++ wrappers for the Liblo library.

Liblo is a library for sending and receiving OSC messages.

Function Documentation

template<class T >
ServerThread::Listener* lowrappers::ListenerMaker ( T &  object,
int(T::*)(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)  fp 
)

A function that conveniently wraps up a GenericServerThreadListener.

For example, let's say you have this class:

class Foo
{
// ...
int bar (const char *path, const char *types,lo_arg **argv, int argc, lo_message msg);
// ...
};

You can now create a ServerThread::Listener whose callback method calls a Foo instance's bar method like this:

Foo* foo = new Foo();
ServerThread::Listener* listener = ListenerMaker(foo, &Foo::bar);

Keep in mind that this creates a (tiny) object that must be deleted when its not needed anymore!

Parameters
objectThe object whose method shall be called as a callback from a ServerThread.
fpA function pointer pointing to the method of object that shall be called from a ServerThread. Must match the signature of ServerThread::Listener::callback, i.e. return int and accept parameters (const char*, const char*, lo_arg**, int, lo_message).
Returns
A ServerThread::Listener whose callback method will call object's fp method.