VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Gv::ViewerEvent Class Reference

A class for receiving and handling events published from a viewer process. More...

#include <gvviewerevent.h>

Classes

struct  Info
 A structure representing an interaction event received from a viewer process. More...
 

Public Types

enum  Type {
  Up, Down, Drag, Move,
  Invalid
}
 

Public Member Functions

 ViewerEvent (const std::string &channel_name=std::string())
 Constructor.
 
Info apply (const std::string &)
 Parses the event string and maintains an internal button state.
 
Info apply (const std::vector< char > &)
 Overload taking a vector.
 
bool init ()
 Tries to subscribe to the viewer's event channel. More...
 
int fd () const
 Returns the subsription file descriptor, or minus one if not init()isalised. More...
 
bool receive (std::vector< char > &, std::string *type_p=nullptr)
 Receives the payload for an event on fd(). More...
 
std::string channelName () const
 Returns the channel name, as passed to the ctor.
 

Detailed Description

A class for receiving and handling events published from a viewer process.

Definition at line 39 of file gvviewerevent.h.

Member Function Documentation

int Gv::ViewerEvent::fd ( ) const

Returns the subsription file descriptor, or minus one if not init()isalised.

Definition at line 47 of file gvviewerevent.cpp.

bool Gv::ViewerEvent::init ( )

Tries to subscribe to the viewer's event channel.

Returns true if newly subscribed.

Definition at line 42 of file gvviewerevent.cpp.

bool Gv::ViewerEvent::receive ( std::vector< char > &  buffer,
std::string *  type_p = nullptr 
)

Receives the payload for an event on fd().

See Also
G::PublisherSubscriber::receive().

Definition at line 52 of file gvviewerevent.cpp.


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