mediapipe/mediapipe/framework/graph_service_manager.cc
MediaPipe Team 7c331ad58b Project import generated by Copybara.
GitOrigin-RevId: 6e4aff1cc351be3ae4537b677f36d139ee50ce09
2021-03-25 22:09:18 -04:00

22 lines
545 B
C++

#include "mediapipe/framework/graph_service_manager.h"
namespace mediapipe {
absl::Status GraphServiceManager::SetServicePacket(
const GraphServiceBase& service, Packet p) {
// TODO: check service is already set?
service_packets_[service.key] = std::move(p);
return absl::OkStatus();
}
Packet GraphServiceManager::GetServicePacket(
const GraphServiceBase& service) const {
auto it = service_packets_.find(service.key);
if (it == service_packets_.end()) {
return {};
}
return it->second;
}
} // namespace mediapipe