![]() |
RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
00001 /* publish_output.h -*- C++ -*- 00002 Jeremy Barnes, 29 May 2011 00003 Copyright (c) 2011 Datacratic. All rights reserved. 00004 00005 Output that publishes on a zeromq socket. 00006 */ 00007 00008 #ifndef __logger__publish_output_h__ 00009 #define __logger__publish_output_h__ 00010 00011 #include "logger.h" 00012 00013 namespace Datacratic { 00014 00015 /*****************************************************************************/ 00016 /* PUBLISH OUTPUT */ 00017 /*****************************************************************************/ 00018 00023 struct PublishOutput : public LogOutput { 00024 00026 PublishOutput(); 00027 00028 PublishOutput(zmq::context_t & context); 00029 00030 PublishOutput(std::shared_ptr<zmq::context_t> context); 00031 00032 virtual ~PublishOutput(); 00033 00037 void bind(const std::string & uri); 00038 00039 virtual void logMessage(const std::string & channel, 00040 const std::string & message); 00041 00042 virtual void close(); 00043 00045 std::shared_ptr<zmq::context_t> context; 00046 00048 zmq::socket_t sock; 00049 }; 00050 00051 00052 00053 00054 } // namespace Datacratic 00055 00056 00057 #endif /* __logger__publish_output_h__ */