RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
00001 /* callback_output.h -*- C++ -*- 00002 Jeremy Barnes, 29 May 2011 00003 Copyright (c) 2011 Datacratic. All rights reserved. 00004 00005 Output that callbacks on a zeromq socket. 00006 */ 00007 00008 #ifndef __logger__callback_output_h__ 00009 #define __logger__callback_output_h__ 00010 00011 #include "logger.h" 00012 00013 namespace Datacratic { 00014 00015 /*****************************************************************************/ 00016 /* CALLBACK OUTPUT */ 00017 /*****************************************************************************/ 00018 00022 struct CallbackOutput : public LogOutput { 00023 00024 typedef boost::function<void (std::string, std::string)> Callback; 00025 00027 CallbackOutput(const Callback & callback); 00028 00029 virtual ~CallbackOutput(); 00030 00031 virtual void logMessage(const std::string & channel, 00032 const std::string & message); 00033 00034 virtual void close(); 00035 00036 Callback callback; 00037 }; 00038 00039 00040 00041 00042 } // namespace Datacratic 00043 00044 00045 #endif /* __logger__callback_output_h__ */