1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * @brief A header file for the Inference Engine plugins destruction mechanism
7 * @file ie_irelease.hpp
11 #include "ie_no_copy.hpp"
14 namespace InferenceEngine {
17 * @brief This class is used for objects allocated by a shared module (in *.so)
19 class IRelease : public no_copy {
22 * @brief Releases current allocated object and all related resources.
23 * Once this method is called, the pointer to this interface is no longer valid
25 virtual void Release() noexcept = 0;
29 * @brief Default destructor
31 ~IRelease() override = default;
36 template <class T> inline std::shared_ptr<T> shared_from_irelease(T * ptr) {
37 std::shared_ptr<T> pointer(ptr, [](IRelease *p) {
43 } // namespace details
44 } // namespace InferenceEngine