blob: 8b9b89cdc231bcf1020111e91bcbda14fd4e678c [file] [log] [blame]
[email protected]2d715662011-11-28 22:00:291// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BASE_CALLBACK_FORWARD_H_
6#define BASE_CALLBACK_FORWARD_H_
[email protected]2d715662011-11-28 22:00:297
8namespace base {
tzik77d411392016-03-09 09:47:039namespace internal {
[email protected]2d715662011-11-28 22:00:2910
tzik77d411392016-03-09 09:47:0311// CopyMode is used to control the copyablity of a Callback.
12// MoveOnly indicates the Callback is not copyable but movable, and Copyable
13// indicates it is copyable and movable.
14enum class CopyMode {
15 MoveOnly, Copyable,
16};
17
18} // namespace internal
19
20template <typename Signature,
21 internal::CopyMode copy_mode = internal::CopyMode::Copyable>
[email protected]2d715662011-11-28 22:00:2922class Callback;
23
tzik3bc7779b2015-12-19 09:18:4624// Syntactic sugar to make Callback<void()> easier to declare since it
tzikce3ecf82015-12-15 06:41:4925// will be used in a lot of APIs with delayed execution.
tzik3bc7779b2015-12-19 09:18:4626using Closure = Callback<void()>;
[email protected]2d715662011-11-28 22:00:2927
28} // namespace base
29
danakj0a448602015-03-10 00:31:1630#endif // BASE_CALLBACK_FORWARD_H_