RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Public Attributes
Datacratic::ZmqBinaryTypedEventSource< Arg > Struct Template Reference

#include <zmq_endpoint.h>

Inheritance diagram for Datacratic::ZmqBinaryTypedEventSource< Arg >:
Datacratic::AsyncEventSource

List of all members.

Public Types

typedef std::function< void(Arg)> MessageHandler

Public Member Functions

 ZmqBinaryTypedEventSource (zmq::socket_t &socket, MessageHandler messageHandler=MessageHandler())
void init (zmq::socket_t &socket)
virtual int selectFd () const
virtual bool poll () const
virtual bool processOne ()
virtual void handleMessage (const Arg &arg)
zmq::socket_tsocket () const

Public Attributes

MessageHandler messageHandler
zmq::socket_tsocket_

Detailed Description

template<typename Arg>
struct Datacratic::ZmqBinaryTypedEventSource< Arg >

An adaptor that is used to deal with a zeromq connection that sends length one messages of a binary data structure.

Definition at line 216 of file zmq_endpoint.h.


Member Function Documentation

template<typename Arg>
virtual bool Datacratic::ZmqBinaryTypedEventSource< Arg >::poll ( ) const [inline, virtual]

Returns true if there is work to be done. May be called from more than one thread. Should never block.

Reimplemented from Datacratic::AsyncEventSource.

Definition at line 251 of file zmq_endpoint.h.

template<typename Arg>
virtual bool Datacratic::ZmqBinaryTypedEventSource< Arg >::processOne ( ) [inline, virtual]

Process a single message and return true if there are more to be processed.

This may be called from more than one thread if singleThreaded() is false.

Implements Datacratic::AsyncEventSource.

Definition at line 268 of file zmq_endpoint.h.

template<typename Arg>
virtual int Datacratic::ZmqBinaryTypedEventSource< Arg >::selectFd ( ) const [inline, virtual]

Return the file descriptor on which one should select() for messages from this source. The source should organize itself such that if the fd indicates ready for a read, there is something to do.

Should return -1 if it requires polling.

Should never block.

Reimplemented from Datacratic::AsyncEventSource.

Definition at line 241 of file zmq_endpoint.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator