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

FUSE client. More...

#include <fvutils/net/fuse_client.h>

Inheritance diagram for FuseClient:

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 40 of file fuse_client.h.


Constructor & Destructor Documentation

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 59 of file fuse_client.cpp.

FuseClient::~FuseClient (  )  [virtual]

Destructor.

Definition at line 85 of file fuse_client.cpp.

References fawkes::RefCount::unref().


Member Function Documentation

void FuseClient::connect (  ) 

void FuseClient::disconnect (  ) 

void FuseClient::enqueue ( FUSE_message_type_t  type  ) 

Enqueue message without payload.

Parameters:
type type of message

Definition at line 201 of file fuse_client.cpp.

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

void 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 190 of file fuse_client.cpp.

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

void FuseClient::enqueue ( FuseNetworkMessage m  ) 

void 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 245 of file fuse_client.cpp.

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

void 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 230 of file fuse_client.cpp.

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

void FuseClient::enqueue_and_wait ( FuseNetworkMessage m  ) 

Enqueue message and wait for reply.

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

Parameters:
m message to enqueue

Definition at line 213 of file fuse_client.cpp.

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

Referenced by NetworkCamera::capture(), NetworkCamera::image_list(), NetworkCamera::open(), and NetworkCamera::set_image_id().

void FuseClient::wait (  ) 

Wait for messages.

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

Definition at line 332 of file fuse_client.cpp.

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

void 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 348 of file fuse_client.cpp.

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

Referenced by NetworkCamera::open(), FireVisionNetworkTool::run(), and FireVisionNetworkTool::service_added().


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