diff options
Diffstat (limited to 'compiler/tflchef/core/include/tflchef/ModelChef.h')
-rw-r--r-- | compiler/tflchef/core/include/tflchef/ModelChef.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/compiler/tflchef/core/include/tflchef/ModelChef.h b/compiler/tflchef/core/include/tflchef/ModelChef.h new file mode 100644 index 000000000..4e22f7555 --- /dev/null +++ b/compiler/tflchef/core/include/tflchef/ModelChef.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __MODEL_CHEF_H__ +#define __MODEL_CHEF_H__ + +#include <tflchef.pb.h> + +#include <memory> + +namespace tflchef +{ + +class GeneratedModel final +{ +public: + struct Impl + { + virtual ~Impl() = default; + + virtual const char *base(void) const = 0; + virtual size_t size(void) const = 0; + }; + +public: + GeneratedModel(std::unique_ptr<Impl> &&impl) : _impl{std::move(impl)} + { + // DO NOTHING + } + +public: + const char *base(void) const { return _impl->base(); } + size_t size(void) const { return _impl->size(); } + +private: + std::unique_ptr<Impl> _impl; +}; + +GeneratedModel cook(const ModelRecipe &model_recipe); + +} // namespace tflchef + +#endif // __MODEL_CHEF_H__ |