1 /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 16 #ifndef TENSORFLOW_CORE_UTIL_PROTO_DESCRIPTORS_H_ 17 #define TENSORFLOW_CORE_UTIL_PROTO_DESCRIPTORS_H_ 18 19 #include <memory> 20 #include <string> 21 22 #include "tensorflow/core/platform/protobuf.h" 23 24 namespace tensorflow { 25 class Env; 26 class Status; 27 28 // Get a `DescriptorPool` object from the named `descriptor_source`. 29 // `descriptor_source` may be a path to a file accessible to TensorFlow, in 30 // which case it is parsed as a `FileDescriptorSet` and used to build the 31 // `DescriptorPool`. 32 // 33 // `owned_desc_pool` will be filled in with the same pointer as `desc_pool` if 34 // the caller should take ownership. 35 extern tensorflow::Status GetDescriptorPool( 36 tensorflow::Env* env, string const& descriptor_source, 37 tensorflow::protobuf::DescriptorPool const** desc_pool, 38 std::unique_ptr<tensorflow::protobuf::DescriptorPool>* owned_desc_pool); 39 40 } // namespace tensorflow 41 42 #endif // TENSORFLOW_CORE_UTIL_PROTO_DESCRIPTORS_H_ 43