aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/util/idestructorcallback.h
blob: afae47effade0b11d325d46dedd3e143c759df16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <memory>

namespace vespalib {

/**
 * Interface for class that performs a callback when instance is
 * destroyed. Typically a shared pointer to an instance is passed
 * around to multiple worker threads that performs portions of a
 * larger task before dropping the shared pointer, triggering the
 * callback when all worker threads have completed.
 */
class IDestructorCallback
{
public:
    using SP = std::shared_ptr<IDestructorCallback>;
    virtual ~IDestructorCallback() = default;
};

} // namespace search