SPAOP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
wonderlo::VSReceiver Class Reference

An OscServer-Thread that calls the message-handling methods of a VisualStreamCallInterface object. More...

#include <VSReceiver.h>

Inheritance diagram for wonderlo::VSReceiver:
Inheritance graph
[legend]
Collaboration diagram for wonderlo::VSReceiver:
Collaboration graph
[legend]

Public Member Functions

 VSReceiver (lo_err_handler err_h)
 Constructor. More...
 
 VSReceiver (const std::string &port, lo_err_handler err_h)
 Constructor. More...
 
 VSReceiver (const std::string &group, const std::string &port, const std::string &ifaceIp, lo_err_handler err_h)
 Constructor. More...
 
virtual ~VSReceiver ()
 Destructor. More...
 
wonder::OscSendercreateSender (const std::string &host, const std::string &port)
 Returns an OscSender that sends from the port of this server thread to the specified destination. More...
 
wonder::OscSenderThreadcreateSenderThread (const std::string &host, const std::string &port)
 
void setListener (VisualStreamReceiver::Listener *listener)
 Sets the Listener. More...
 
void setPingHandler (PingHandler *pingHandler)
 Sets the PingHandler. More...
 
void start ()
 Starts this server thread. More...
 
void stop ()
 Stops this server thread. More...
 
void join ()
 Joins this server thread. More...
 
int port ()
 Returns the port this server-thread is listening on. More...
 
- Public Member Functions inherited from lowrappers::ServerThread
 ServerThread (lo_err_handler err_h)
 Constructor. More...
 
 ServerThread (const std::string &port, lo_err_handler err_h)
 Constructor. More...
 
 ServerThread (const std::string &group, const std::string &port, lo_err_handler err_h)
 Constructor. More...
 
 ServerThread (const std::string &group, const std::string &port, const std::string &ifaceIp, lo_err_handler err_h)
 Constructor. More...
 
virtual ~ServerThread ()
 Destructor. More...
 
bool isValid () const
 Checks if initialization was successfull. More...
 
std::string url () const
 An URL describing the address of the server thread. More...
 
int port () const
 The port number that the server thread has bound to. More...
 
bool addMethod (const char *path, const char *typespec, lo_method_handler h, void *user_data)
 Adds a lo_method_handler to this server thread. More...
 
bool addListener (const char *path, const char *typespec, Listener *listener)
 Adds a Listener to this server thread. More...
 
void delMethod (const char *path, const char *typespec)
 Delete a method from this server thread. More...
 
- Public Member Functions inherited from thread::Thread
 Thread ()
 Constructor. More...
 
virtual ~Thread ()
 Destructor. More...
 
void start ()
 Starts the Thread. More...
 
void stop ()
 Sets the internal flag stopped_ to true. More...
 
void join ()
 Joins the thread. More...
 
- Public Member Functions inherited from wonder::VisualStreamReceiver
virtual ~VisualStreamReceiver ()
 Destructor. More...
 
virtual void setListener (Listener *listener)=0
 Sets the Listener to be called on incoming OSC messages. More...
 

Static Public Member Functions

static
wonder::VisualStreamReceiver::Factory
getFactory ()
 A singleton-getter for a wonder::VisualStreamReceiver::Factory that creates instances of VSReceiver. More...
 

Additional Inherited Members

- Protected Member Functions inherited from thread::Thread
bool isStopped () const
 Returns true if the thread was stopped. More...
 

Detailed Description

An OscServer-Thread that calls the message-handling methods of a VisualStreamCallInterface object.

Constructor & Destructor Documentation

wonderlo::VSReceiver::VSReceiver ( lo_err_handler  err_h)

Constructor.

An unused port will be chosen by the sytem as the port this VSReceiver will listen on.

Parameters
err_hA lo_error_handler that will be passed to the internal lo_server_thread. See the liblo documentation for more details.
wonderlo::VSReceiver::VSReceiver ( const std::string &  port,
lo_err_handler  err_h 
)

Constructor.

Parameters
portThe port this VSReceiver will listen on.
err_hA lo_error_handler that will be passed to the internal lo_server_thread. See the liblo documentation for more details.
wonderlo::VSReceiver::VSReceiver ( const std::string &  group,
const std::string &  port,
const std::string &  ifaceIp,
lo_err_handler  err_h 
)

Constructor.

Creates a VSReceiver that joins a specified multicast group, listening on a specified interface.

Parameters
groupThe multicast group to join.
portA decimal port number, service name or UNIX domain socket path may be passed. Note that differently from lo_server_tread_new, passing NULL is not allowed.
ifaceIpA string specifying the network interface to use by its IP.
err_hA function that will be called in the event of an error being raised. The function prototype is defined in lo_types.h
wonderlo::VSReceiver::~VSReceiver ( )
virtual

Destructor.

Member Function Documentation

wonder::OscSender * wonderlo::VSReceiver::createSender ( const std::string &  host,
const std::string &  port 
)
virtual

Returns an OscSender that sends from the port of this server thread to the specified destination.

Returned here is actually an instance of VSServerSender.

Parameters
hostA valid hostname or ip string (see the liblo documentation for what exactly is supported).
portA validport number or service name (see the liblo documentation for what exactly is supported).
Returns
A OscSender that sends from the port of this server thread to the specified destination. Returned here is actually an instance of VSServerSender.

Implements wonder::VisualStreamReceiver.

wonder::OscSenderThread * wonderlo::VSReceiver::createSenderThread ( const std::string &  host,
const std::string &  port 
)
virtual
wonder::VisualStreamReceiver::Factory * wonderlo::VSReceiver::getFactory ( )
static

A singleton-getter for a wonder::VisualStreamReceiver::Factory that creates instances of VSReceiver.

void wonderlo::VSReceiver::join ( )
virtual

Joins this server thread.

Implements wonder::VisualStreamReceiver.

int wonderlo::VSReceiver::port ( )
virtual

Returns the port this server-thread is listening on.

Implements wonder::VisualStreamReceiver.

void wonderlo::VSReceiver::setListener ( VisualStreamReceiver::Listener *  listener)

Sets the Listener.

Only one listener is supported (so far), and it is not confirmed whether it is possible to change the listener from one Listener instance to another.

void wonderlo::VSReceiver::setPingHandler ( PingHandler pingHandler)
virtual

Sets the PingHandler.

Only one PingHandler is supported (so far), and it is not confirmed whether it is possible to change the PingHandler from one instance to another.

Implements wonder::VisualStreamReceiver.

void wonderlo::VSReceiver::start ( )
virtual

Starts this server thread.

Implements wonder::VisualStreamReceiver.

void wonderlo::VSReceiver::stop ( )
virtual

Stops this server thread.

Implements wonder::VisualStreamReceiver.