blob: 50d2f93713ee11d11a5c8e92691fa2e3b5edd47a [file]
#ifndef PRODUCTION_BORG_MGMT_NODE_PROXY_SAFEPOWER_SAFEPOWER_AGENT_FLIGHT_RECORD_H_
#define PRODUCTION_BORG_MGMT_NODE_PROXY_SAFEPOWER_SAFEPOWER_AGENT_FLIGHT_RECORD_H_
#include <ostream>
#include <string>
#include <utility>
#include "utils.pb.h"
#include "absl/hash/hash.h"
namespace safepower_agent {
class FlightRecordWrapper {
public:
explicit FlightRecordWrapper(
borg_mgmt::node_proxy::safepower::utils::FlightRecordRequest request);
const std::string& flight_name() const;
const std::string& step_id() const;
const borg_mgmt::node_proxy::safepower::utils::FlightRecordRequest& request()
const;
template <typename H>
friend H AbslHashValue(H h, const FlightRecordWrapper& r) {
return H::combine(std::move(h), r.flight_name(), r.step_id());
}
friend bool operator==(const FlightRecordWrapper& lhs,
const FlightRecordWrapper& rhs);
template <typename Sink>
friend void AbslStringify(Sink& sink, const FlightRecordWrapper& r) {
sink.Append("(");
sink.Append(r.flight_name());
sink.Append(", ");
sink.Append(r.step_id());
sink.Append(")");
}
friend std::ostream& operator<<(std::ostream& os,
const FlightRecordWrapper& r);
private:
borg_mgmt::node_proxy::safepower::utils::FlightRecordRequest request_;
};
} // namespace safepower_agent
#endif // PRODUCTION_BORG_MGMT_NODE_PROXY_SAFEPOWER_SAFEPOWER_AGENT_FLIGHT_RECORD_H_