RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
00001 /* json_filter.h -*- C++ -*- 00002 Jeremy Barnes, 5 June 2011 00003 Copyright (c) 2011 Datacratic. All rights reserved. 00004 00005 Pre-compression filter for JSON data. 00006 */ 00007 00008 #ifndef __logger__json_filter_h__ 00009 #define __logger__json_filter_h__ 00010 00011 #include "filter.h" 00012 00013 namespace Datacratic { 00014 00015 /*****************************************************************************/ 00016 /* JSON COMPRESSOR */ 00017 /*****************************************************************************/ 00018 00021 struct JsonCompressor: public Filter { 00022 00023 JsonCompressor(); 00024 ~JsonCompressor(); 00025 00026 using Filter::process; 00027 00028 virtual void process(const char * src_begin, const char * src_end, 00029 FlushLevel level, 00030 boost::function<void ()> onMessageDone); 00031 00032 private: 00033 struct Itl; 00034 std::shared_ptr<Itl> itl; 00035 }; 00036 00037 00038 00039 /*****************************************************************************/ 00040 /* JSON DECOMPRESSOR */ 00041 /*****************************************************************************/ 00042 00045 struct JsonDecompressor: public Filter { 00046 00047 JsonDecompressor(); 00048 ~JsonDecompressor(); 00049 00050 using Filter::process; 00051 00052 virtual void process(const char * src_begin, const char * src_end, 00053 FlushLevel level, 00054 boost::function<void ()> onMessageDone); 00055 00056 private: 00057 struct Itl; 00058 std::shared_ptr<Itl> itl; 00059 }; 00060 00061 } // namespace Datacratic 00062 00063 00064 #endif /* __logger__json_filter_h__ */ 00065