7c331ad58b
GitOrigin-RevId: 6e4aff1cc351be3ae4537b677f36d139ee50ce09
22 lines
545 B
C++
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
|