Esempio n. 1
0
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;
}
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;
}