bool UploadFiles()

in rosbag_cloud_recorders/include/rosbag_cloud_recorders/utils/s3_client_utils.h [47:81]


bool UploadFiles(
  GoalHandleT& goal_handle,
  const double upload_time_out,
  UploadClientT& upload_client,
  std::vector<std::string>& ros_bags_to_upload)
{
  AWS_LOG_INFO(__func__, "Uploading Files.");

  auto goal = Utils::ConstructRosBagUploaderGoal(goal_handle.getGoal()->destination, ros_bags_to_upload);
  upload_client.sendGoal(goal);

  // Getting the Feedback type from the type of the first arugment to GoalHandleT::publishFeedback()
  // because GoalHandleT::Feedback is a private typedef
  using FuncType = decltype(&GoalHandleT::publishFeedback);
  using FuncArgsType = typename boost::function_types::parameter_types<FuncType>;
  using ArgCrefType = typename boost::mpl::at_c<FuncArgsType, 1>::type;
  using ArgConstType = typename boost::remove_reference<ArgCrefType>::type;
  using ArgType = typename boost::remove_const<ArgConstType>::type;
  ArgType recorder_feedback;
  recorder_msgs::RecorderStatus recording_status;
  Utils::GenerateFeedback(
    recorder_msgs::RecorderStatus::UPLOADING,
    ros::Time::now(),
    recorder_feedback,
    recording_status);
  goal_handle.publishFeedback(recorder_feedback);
  bool upload_finished = true;
  if (upload_time_out > 0) {
    upload_finished = upload_client.waitForResult(ros::Duration(upload_time_out));
  } else {
    upload_finished = upload_client.waitForResult();
  }

  return upload_finished;
}