FuseClient Class Reference
[FireVision FUSE Network Protocol, FireVision Image Processing Framework and Applications]
FUSE client.
More...
#include <fvutils/net/fuse_client.h>

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.
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] |
Member Function Documentation
| void FuseClient::connect | ( | ) |
Connect.
Definition at line 114 of file fuse_client.cpp.
References fawkes::Socket::connect(), and FUSE_greeting_message_t::version.
Referenced by NetworkCamera::open(), FireVisionNetworkTool::run(), and FireVisionNetworkTool::service_added().
| void FuseClient::disconnect | ( | ) |
Disconnect.
Definition at line 127 of file fuse_client.cpp.
References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().
Referenced by NetworkCamera::close(), FuseImageListWidget::~FuseImageListWidget(), and FuseTransferWidget::~FuseTransferWidget().
| 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 | ) |
Enqueue message.
- Parameters:
-
m message to enqueue
Definition at line 177 of file fuse_client.cpp.
References fawkes::LockQueue< Type >::push_locked(), and fawkes::RefCount::ref().
Referenced by FireVisionNetworkTool::get_colormap(), FireVisionNetworkTool::get_image(), FireVisionNetworkTool::set_colormap(), and FireVisionNetworkTool::show_all().
| 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::loop | ( | ) | [virtual] |
Thread loop.
Sends enqueued messages and reads incoming messages off the network.
Reimplemented from fawkes::Thread.
Definition at line 275 of file fuse_client.cpp.
References FuseClientHandler::fuse_connection_established(), FuseClientHandler::fuse_inbound_received(), FuseClientHandler::fuse_invalid_server_version(), fawkes::LockQueue< Type >::lock(), fawkes::Mutex::lock(), FuseNetworkMessage::msg(), FuseNetworkMessage::type(), fawkes::LockQueue< Type >::unlock(), fawkes::Mutex::unlock(), fawkes::RefCount::unref(), FUSE_greeting_message_t::version, and fawkes::WaitCondition::wake_all().
| 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:
- src/firevision/fvutils/net/fuse_client.h
- src/firevision/fvutils/net/fuse_client.cpp

