blob: 8b9b89cdc231bcf1020111e91bcbda14fd4e678c [file] [log] [blame]
Vitaly Bukacbed2062015-08-17 12:54:05 -07001// 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_
7
8namespace base {
Alex Vakulenkobf79a9e2016-03-28 15:11:43 -07009namespace internal {
Vitaly Bukacbed2062015-08-17 12:54:05 -070010
Alex Vakulenkobf79a9e2016-03-28 15:11:43 -070011// 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>
Vitaly Bukacbed2062015-08-17 12:54:05 -070022class Callback;
23
Alex Vakulenko674f0eb2016-01-20 08:10:48 -080024// Syntactic sugar to make Callback<void()> easier to declare since it
25// will be used in a lot of APIs with delayed execution.
26using Closure = Callback<void()>;
Vitaly Bukacbed2062015-08-17 12:54:05 -070027
28} // namespace base
29
30#endif // BASE_CALLBACK_FORWARD_H_