File indexing completed on 2026-04-17 08:35:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef PEEKPROCESSOR_H
0021 #define PEEKPROCESSOR_H
0022
0023 #include <string>
0024 #include <thrift/TProcessor.h>
0025 #include <thrift/transport/TTransport.h>
0026 #include <thrift/transport/TTransportUtils.h>
0027 #include <thrift/transport/TBufferTransports.h>
0028 #include <memory>
0029
0030 namespace apache {
0031 namespace thrift {
0032 namespace processor {
0033
0034
0035
0036
0037
0038
0039 class PeekProcessor : public apache::thrift::TProcessor {
0040
0041 public:
0042 PeekProcessor();
0043 ~PeekProcessor() override;
0044
0045
0046
0047
0048
0049 void initialize(
0050 std::shared_ptr<apache::thrift::TProcessor> actualProcessor,
0051 std::shared_ptr<apache::thrift::protocol::TProtocolFactory> protocolFactory,
0052 std::shared_ptr<apache::thrift::transport::TPipedTransportFactory> transportFactory);
0053
0054 std::shared_ptr<apache::thrift::transport::TTransport> getPipedTransport(
0055 std::shared_ptr<apache::thrift::transport::TTransport> in);
0056
0057 void setTargetTransport(std::shared_ptr<apache::thrift::transport::TTransport> targetTransport);
0058
0059 bool process(std::shared_ptr<apache::thrift::protocol::TProtocol> in,
0060 std::shared_ptr<apache::thrift::protocol::TProtocol> out,
0061 void* connectionContext) override;
0062
0063
0064
0065 virtual void peekName(const std::string& fname);
0066 virtual void peekBuffer(uint8_t* buffer, uint32_t size);
0067 virtual void peek(std::shared_ptr<apache::thrift::protocol::TProtocol> in,
0068 apache::thrift::protocol::TType ftype,
0069 int16_t fid);
0070 virtual void peekEnd();
0071
0072 private:
0073 std::shared_ptr<apache::thrift::TProcessor> actualProcessor_;
0074 std::shared_ptr<apache::thrift::protocol::TProtocol> pipedProtocol_;
0075 std::shared_ptr<apache::thrift::transport::TPipedTransportFactory> transportFactory_;
0076 std::shared_ptr<apache::thrift::transport::TMemoryBuffer> memoryBuffer_;
0077 std::shared_ptr<apache::thrift::transport::TTransport> targetTransport_;
0078 };
0079 }
0080 }
0081 }
0082
0083 #endif