TensorFlow Serving C++ API Documentation
source.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_SOURCE_H_
17 #define TENSORFLOW_SERVING_CORE_SOURCE_H_
18 
19 #include <functional>
20 #include <vector>
21 
22 #include "tensorflow/core/lib/core/stringpiece.h"
23 #include "tensorflow/core/lib/io/path.h"
24 #include "tensorflow/core/lib/strings/str_util.h"
25 #include "tensorflow/core/lib/strings/strcat.h"
26 #include "tensorflow_serving/core/servable_data.h"
27 
28 namespace tensorflow {
29 namespace serving {
30 
64 template <typename T>
65 class Source {
66  public:
67  virtual ~Source() = default;
68 
87  using AspiredVersionsCallback = std::function<void(
88  const StringPiece servable_name, std::vector<ServableData<T>> versions)>;
89 
92 };
93 
94 } // namespace serving
95 } // namespace tensorflow
96 
97 #endif // TENSORFLOW_SERVING_CORE_SOURCE_H_
virtual void SetAspiredVersionsCallback(AspiredVersionsCallback callback)=0
Supplies an AspiredVersionsCallback to use. Can be called at most once.
std::function< void(const StringPiece servable_name, std::vector< ServableData< T > > versions)> AspiredVersionsCallback
Definition: source.h:88