VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
G::PublisherSubscriber Class Reference

A publication-channel subscriber endpoint. More...

#include <gpublisher.h>

Public Member Functions

 PublisherSubscriber (PublisherChannel &, size_t slot_id, int socket_fd)
 Pseudo-private constructor, used by G::PublisherChannel.
 
 ~PublisherSubscriber ()
 Destructor.
 
size_t id () const
 Returns the slot id.
 
int fd () const
 Returns the named socket file descriptor.
 
bool receive (std::vector< char > &buffer, std::string *type_p=nullptr, G::EpochTime *time_p=nullptr)
 Does a read for new publish()ed data. More...
 
bool peek (std::vector< char > &buffer, std::string *type_p=nullptr, G::EpochTime *time_p=nullptr)
 Does a receive() but without requiring a publication event. More...
 

Detailed Description

A publication-channel subscriber endpoint.

Definition at line 191 of file gpublisher.h.

Member Function Documentation

bool G::PublisherSubscriber::peek ( std::vector< char > &  buffer,
std::string *  type_p = nullptr,
G::EpochTime time_p = nullptr 
)

Does a receive() but without requiring a publication event.

Returns false if no data is available.

Definition at line 383 of file gpublisher.cpp.

bool G::PublisherSubscriber::receive ( std::vector< char > &  buffer,
std::string *  type_p = nullptr,
G::EpochTime time_p = nullptr 
)

Does a read for new publish()ed data.

Blocks if there is nothing to read. Returns false if the publisher has gone away. Returns an empty buffer in the case of an ignorable event.

Definition at line 378 of file gpublisher.cpp.


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