Public Member Functions

firevision::FuseClient Class Reference
[FireVision FUSE Network ProtocolFireVision Image Processing Framework and Applications]

FUSE client. More...

#include <>>

Inheritance diagram for firevision::FuseClient:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FuseClient (const char *hostname, unsigned short int port, FuseClientHandler *handler)
 Constructor.
virtual ~FuseClient ()
 Destructor.
void connect ()
 Connect.
void disconnect ()
 Disconnect.
void enqueue (FuseNetworkMessage *m)
 Enqueue message.
void enqueue (FUSE_message_type_t type, void *payload, size_t payload_size)
 Enqueue message.
void enqueue (FUSE_message_type_t type)
 Enqueue message without payload.
void enqueue_and_wait (FuseNetworkMessage *message)
 Enqueue message and wait for reply.
void enqueue_and_wait (FUSE_message_type_t type, void *payload, size_t payload_size)
 Enqueue message and wait for reply.
void enqueue_and_wait (FUSE_message_type_t type)
 Enqueue message without payload and wait for reply.
void wait ()
 Wait for messages.
void wait_greeting ()
 Wait for greeting message.
virtual void loop ()
 Thread loop.

Detailed Description

FUSE client.

FUSE is the FireVision protocol to retrieve information, images and lookup tables from vision processes and to send control commands to these systems. The client is used in the retrieving or controlling process.

Author:
Tim Niemueller

Definition at line 45 of file fuse_client.h.


Constructor & Destructor Documentation

firevision::FuseClient::FuseClient ( const char *  hostname,
unsigned short int  port,
FuseClientHandler handler 
)

Constructor.

Parameters:
hostname host to connect to
port port to connect to
handler client handler to handle incoming data

Definition at line 64 of file fuse_client.cpp.

firevision::FuseClient::~FuseClient (  )  [virtual]

Destructor.

Definition at line 90 of file fuse_client.cpp.

References fawkes::RefCount::unref().


Member Function Documentation

void firevision::FuseClient::connect (  ) 

Connect.

Definition at line 119 of file fuse_client.cpp.

References fawkes::Socket::connect(), and firevision::FUSE_greeting_message_t::version.

void firevision::FuseClient::disconnect (  ) 
void firevision::FuseClient::enqueue ( FUSE_message_type_t  type,
void *  payload,
size_t  payload_size 
)

Enqueue message.

Parameters:
type type of message
payload payload of message
payload_size size of payload

Definition at line 196 of file fuse_client.cpp.

References fawkes::LockQueue< Type >::push_locked().

void firevision::FuseClient::enqueue ( FUSE_message_type_t  type  ) 

Enqueue message without payload.

Parameters:
type type of message

Definition at line 207 of file fuse_client.cpp.

References fawkes::LockQueue< Type >::push_locked().

void firevision::FuseClient::enqueue ( FuseNetworkMessage m  ) 

Enqueue message.

This method takes ownership of the passed message. You must explicitly reference it before enqueing if you want to use it afterwards.

Parameters:
m message to enqueue

Definition at line 184 of file fuse_client.cpp.

References fawkes::LockQueue< Type >::push_locked().

void firevision::FuseClient::enqueue_and_wait ( FUSE_message_type_t  type,
void *  payload,
size_t  payload_size 
)

Enqueue message and wait for reply.

The wait happens atomically, use this to avoid race conditions.

Parameters:
type type of message
payload payload of message
payload_size size of payload

Definition at line 237 of file fuse_client.cpp.

References fawkes::Mutex::lock(), fawkes::LockQueue< Type >::push_locked(), fawkes::Mutex::unlock(), and fawkes::WaitCondition::wait().

void firevision::FuseClient::enqueue_and_wait ( FUSE_message_type_t  type  ) 

Enqueue message without payload and wait for reply.

The wait happens atomically, use this to avoid race conditions.

Parameters:
type type of message

Definition at line 252 of file fuse_client.cpp.

References fawkes::Mutex::lock(), fawkes::LockQueue< Type >::push_locked(), fawkes::Mutex::unlock(), and fawkes::WaitCondition::wait().

void firevision::FuseClient::enqueue_and_wait ( FuseNetworkMessage m  ) 

Enqueue message and wait for reply.

The wait happens atomically, use this to avoid race conditions. This method takes ownership of the passed message. You must explicitly reference it before enqueing if you want to use it afterwards.

Parameters:
m message to enqueue

Definition at line 221 of file fuse_client.cpp.

References fawkes::Mutex::lock(), fawkes::LockQueue< Type >::push_locked(), fawkes::Mutex::unlock(), and fawkes::WaitCondition::wait().

Referenced by firevision::NetworkCamera::image_list(), and firevision::NetworkCamera::set_image_id().

void firevision::FuseClient::loop (  )  [virtual]
void firevision::FuseClient::wait (  ) 

Wait for messages.

This will wait for messages to arrive. The calling thread is blocked until messages are available.

Definition at line 338 of file fuse_client.cpp.

References fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::WaitCondition::wait().

void firevision::FuseClient::wait_greeting (  ) 

Wait for greeting message.

This method will wait for the greeting message to arrive. Make sure that you called connect() before waiting or call it concurrently in another thread. The calling thread will be blocked until the message has been received. If the message has already been received this method will return immediately. Thus it is safe to call this at any time without risking a race condition.

Definition at line 354 of file fuse_client.cpp.

References fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::WaitCondition::wait().


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