OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_BASE_FUNCTION_VIEW_H_ | 11 #ifndef WEBRTC_RTC_BASE_FUNCTION_VIEW_H_ |
12 #define WEBRTC_BASE_FUNCTION_VIEW_H_ | 12 #define WEBRTC_RTC_BASE_FUNCTION_VIEW_H_ |
13 | 13 |
14 #include <type_traits> | 14 #include <type_traits> |
15 #include <utility> | 15 #include <utility> |
16 | 16 |
17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
18 | 18 |
19 // Just like std::function, FunctionView will wrap any callable and hide its | 19 // Just like std::function, FunctionView will wrap any callable and hide its |
20 // actual type, exposing only its signature. But unlike std::function, | 20 // actual type, exposing only its signature. But unlike std::function, |
21 // FunctionView doesn't own its callable---it just points to it. Thus, it's a | 21 // FunctionView doesn't own its callable---it just points to it. Thus, it's a |
22 // good choice mainly as a function argument when the callable argument will | 22 // good choice mainly as a function argument when the callable argument will |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 VoidUnion f_; | 120 VoidUnion f_; |
121 | 121 |
122 // Pointer to a dispatch function that knows the type of the callable thing | 122 // Pointer to a dispatch function that knows the type of the callable thing |
123 // that's stored in f_, and how to call it. A FunctionView object is empty | 123 // that's stored in f_, and how to call it. A FunctionView object is empty |
124 // (null) iff call_ is null. | 124 // (null) iff call_ is null. |
125 RetT (*call_)(VoidUnion, ArgT...); | 125 RetT (*call_)(VoidUnion, ArgT...); |
126 }; | 126 }; |
127 | 127 |
128 } // namespace rtc | 128 } // namespace rtc |
129 | 129 |
130 #endif // WEBRTC_BASE_FUNCTION_VIEW_H_ | 130 #endif // WEBRTC_RTC_BASE_FUNCTION_VIEW_H_ |
OLD | NEW |