rgbd
|
Client which uses shared memory, requires a server on the same machine. More...
#include <client_shm.h>
Public Member Functions | |
ClientSHM () | |
Constructor. More... | |
bool | deinitialize () |
Clears all the shared memory classes to nullptrs or empty classes. initialized will now return false. More... | |
bool | initialize (const std::string &server_name, float timeout=5.0) |
Initialize shared memory client. More... | |
bool | initialized () |
Check if the client is initialized. nextImage shouldn't be called if client is not initialized. More... | |
ImagePtr | nextImage () |
Get a new Image. If no new image has been received, the sequence nummer is still the same as the previous call, The ImagePtr will be a nullptr. More... | |
bool | nextImage (Image &image) |
Get a new Image. If no new image has been received, the sequence nummer is still the same as the previous call, no image will be written and false will be returned. More... | |
~ClientSHM () | |
Destructor. More... | |
Private Attributes | |
BufferHeader * | buffer_header_ |
uint64_t | depth_data_size_ |
unsigned char * | image_data_ |
boost::interprocess::mapped_region | mem_buffer_header_ |
boost::interprocess::mapped_region | mem_image_ |
uint64_t | rgb_data_size_ |
uint64_t | sequence_nr_ |
sequence_nr Contains the sequence nummer of the last NextImage call More... | |
boost::interprocess::shared_memory_object | shm_ |
Client which uses shared memory, requires a server on the same machine.
Definition at line 16 of file client_shm.h.
rgbd::ClientSHM::ClientSHM | ( | ) |
Constructor.
buffer_header_ and image_data_ pointers are initialized to nullptr
Definition at line 21 of file client_shm.cpp.
rgbd::ClientSHM::~ClientSHM | ( | ) |
Destructor.
buffer_header_ and image_data_ are not deleted as the client doesn't close the shared memory
Definition at line 27 of file client_shm.cpp.
bool rgbd::ClientSHM::deinitialize | ( | ) |
Clears all the shared memory classes to nullptrs or empty classes. initialized will now return false.
Definition at line 77 of file client_shm.cpp.
bool rgbd::ClientSHM::initialize | ( | const std::string & | server_name, |
float | timeout = 5.0 |
||
) |
Initialize shared memory client.
server_name | Fully resolved server name |
timeout | Timeout to wait for shared memory server |
Definition at line 33 of file client_shm.cpp.
|
inline |
Check if the client is initialized. nextImage shouldn't be called if client is not initialized.
Definition at line 53 of file client_shm.h.
ImagePtr rgbd::ClientSHM::nextImage | ( | ) |
Get a new Image. If no new image has been received, the sequence nummer is still the same as the previous call, The ImagePtr will be a nullptr.
Definition at line 145 of file client_shm.cpp.
bool rgbd::ClientSHM::nextImage | ( | Image & | image | ) |
Get a new Image. If no new image has been received, the sequence nummer is still the same as the previous call, no image will be written and false will be returned.
image | Image reference which will be written. |
Definition at line 89 of file client_shm.cpp.
|
private |
Definition at line 77 of file client_shm.h.
|
private |
Definition at line 81 of file client_shm.h.
|
private |
Definition at line 78 of file client_shm.h.
|
private |
Definition at line 74 of file client_shm.h.
|
private |
Definition at line 75 of file client_shm.h.
|
private |
Definition at line 80 of file client_shm.h.
|
private |
sequence_nr Contains the sequence nummer of the last NextImage call
Definition at line 86 of file client_shm.h.
|
private |
Definition at line 72 of file client_shm.h.