OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_ | |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_ | |
7 | |
8 namespace mojo { | |
9 namespace internal { | |
10 | |
11 // Array type information needed for valdiation. | |
12 template <uint32_t in_expected_num_elements, | |
13 bool in_element_is_nullable, | |
14 typename InElementValidateParams> | |
15 class ArrayValidateParams { | |
16 public: | |
17 // Validation information for elements. It is either another specialization | |
18 // of ArrayValidateParams (if elements are arrays, or the value type of a map | |
yzshen1
2014/10/09 17:41:58
In the map case, ElementValidateParams is for the
| |
19 // is arrays) or NoValidateParams. | |
20 typedef InElementValidateParams ElementValidateParams; | |
21 | |
22 // If |expected_num_elements| is not 0, the array is expected to have exactly | |
23 // that number of elements. | |
24 static const uint32_t expected_num_elements = in_expected_num_elements; | |
25 // Whether the elements are nullable. | |
26 static const bool element_is_nullable = in_element_is_nullable; | |
27 }; | |
28 | |
29 // NoValidateParams is used to indicate the end of an ArrayValidateParams chain. | |
30 class NoValidateParams {}; | |
31 | |
32 } // namespace internal | |
33 } // namespace mojo | |
34 | |
35 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_ | |
OLD | NEW |