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