コード例 #1
0
ファイル: MockServer.cpp プロジェクト: Jasonudoo/fbthrift
std::string MockProcessor::readBuffer(std::unique_ptr<folly::IOBuf>&& buffer) {
  Reader reader;
  reader.setInput(buffer.get());

  std::string messageName;
  MessageType messageType;
  int32_t seqId;
  Param param;

  reader.readMessageBegin(messageName, messageType, seqId);
  param.read(&reader);
  reader.readMessageEnd();

  EXPECT_EQ(messageName, "TEST_CALL");
  EXPECT_EQ(messageType, T_CALL);
  EXPECT_EQ(seqId, 0);

  return param.msg;
}
コード例 #2
0
int main(int argc, char **argv) {
  boost::timer::auto_cpu_timer t;

  /// set logger
  Logger::instance().init("xtp");

  /// get command line arguments
  CMDParser cmdPaser(argc, argv);

  /// read configuration file
  Param config;
  config.read(cmdPaser.getParfilePath());

  INFO() << "Print the configuration:";
  config.print();

  XTPReader xtpReader(config.getInDataPath());

  XTPHeader header = xtpReader.readXTPHeader();
  header.print();

  INFO() << "program exit normally";
  return 0;
}