TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Public Types | Public Member Functions | List of all members
cpid::BlobPublisher Class Referencefinal

Publisher for ZeroMQ PUB-SUB pattern. More...

#include <blobpubsub.h>

Public Types

enum  DataFlags { None = 0, HasData = 1 << 0, NewData = 1 << 1 }
 

Public Member Functions

 BlobPublisher (std::string endpoint=std::string(), std::shared_ptr< zmq::context_t > context=nullptr)
 
 ~BlobPublisher ()
 
std::string endpoint () const
 
void publish (void const *data, size_t len, int64_t tag)
 
void publish (std::vector< char > &&data, int64_t tag)
 

Detailed Description

Publisher for ZeroMQ PUB-SUB pattern.

This server will publish binary blobs at endpoint(). The last published blob will be cached and re-published if new subscribers are joining.

Published data consists of both a tag and binary data. The tag can be used to disambiguiate blobs on the subscriber side but does not affect transport.

Member Enumeration Documentation

Enumerator
None 
HasData 
NewData 

Constructor & Destructor Documentation

cpid::BlobPublisher::BlobPublisher ( std::string  endpoint = std::string(),
std::shared_ptr< zmq::context_t >  context = nullptr 
)
cpid::BlobPublisher::~BlobPublisher ( )

Member Function Documentation

std::string cpid::BlobPublisher::endpoint ( ) const
void cpid::BlobPublisher::publish ( void const *  data,
size_t  len,
int64_t  tag 
)
void cpid::BlobPublisher::publish ( std::vector< char > &&  data,
int64_t  tag 
)

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