TensorFlow Serving C++ API Documentation
manager_wrapper.h
1 /* Copyright 2016 Google Inc. 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_SERVING_CORE_MANAGER_WRAPPER_H_
17 #define TENSORFLOW_SERVING_CORE_MANAGER_WRAPPER_H_
18 
19 #include <map>
20 #include <memory>
21 #include <vector>
22 
23 #include "tensorflow_serving/core/manager.h"
24 #include "tensorflow_serving/core/servable_id.h"
25 #include "tensorflow_serving/util/unique_ptr_with_deps.h"
26 
27 namespace tensorflow {
28 namespace serving {
29 
30 // An implementation of Manager that delegates all calls to another Manager.
31 //
32 // May be useful to override just part of the functionality of another Manager
33 // or storing a Manager with its dependencies.
34 class ManagerWrapper : public Manager {
35  public:
37  ~ManagerWrapper() override = default;
38 
39  std::vector<ServableId> ListAvailableServableIds() const override;
40 
41  private:
42  Status GetUntypedServableHandle(
43  const ServableRequest& request,
44  std::unique_ptr<UntypedServableHandle>* untyped_handle) override;
45 
46  std::map<ServableId, std::unique_ptr<UntypedServableHandle>>
47  GetAvailableUntypedServableHandles() const override;
48 
49  const UniquePtrWithDeps<Manager> wrapped_;
50 };
51 
52 } // namespace serving
53 } // namespace tensorflow
54 
55 #endif // TENSORFLOW_SERVING_CORE_MANAGER_WRAPPER_H_
std::vector< ServableId > ListAvailableServableIds() const override