erg@google.com | b16c8a6 | 2010-08-25 05:29:02 +0900 | [diff] [blame] | 1 | // Copyright (c) 2010 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 IPC_IPC_PARAM_TRAITS_H_ |
| 6 | #define IPC_IPC_PARAM_TRAITS_H_ |
erg@google.com | b16c8a6 | 2010-08-25 05:29:02 +0900 | [diff] [blame] | 7 | |
| 8 | // Our IPC system uses the following partially specialized header to define how |
| 9 | // a data type is read, written and logged in the IPC system. |
| 10 | |
| 11 | namespace IPC { |
Yuzhu Shen | f0ea075 | 2017-07-19 07:43:11 +0900 | [diff] [blame] | 12 | namespace internal { |
| 13 | |
| 14 | template <typename T> |
| 15 | struct AlwaysFalse { |
| 16 | static const bool value = false; |
| 17 | }; |
| 18 | |
| 19 | } // namespace internal |
erg@google.com | b16c8a6 | 2010-08-25 05:29:02 +0900 | [diff] [blame] | 20 | |
| 21 | template <class P> struct ParamTraits { |
Yuzhu Shen | f0ea075 | 2017-07-19 07:43:11 +0900 | [diff] [blame] | 22 | static_assert(internal::AlwaysFalse<P>::value, |
| 23 | "Cannot find the IPC::ParamTraits specialization. Did you " |
| 24 | "forget to include the corresponding header file?"); |
erg@google.com | b16c8a6 | 2010-08-25 05:29:02 +0900 | [diff] [blame] | 25 | }; |
| 26 | |
| 27 | template <class P> |
| 28 | struct SimilarTypeTraits { |
| 29 | typedef P Type; |
| 30 | }; |
| 31 | |
| 32 | } // namespace IPC |
| 33 | |
| 34 | #endif // IPC_IPC_PARAM_TRAITS_H_ |