Update path-to-regexp to address CVE-2024-45296 (#5895)
[KhronosGroup/SPIRV-Tools.git] / source / fuzz / data_descriptor.h
blobf4b8e9c0c316fcb92d9f757adc6e4b263e580e22
1 // Copyright (c) 2019 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 #ifndef SOURCE_FUZZ_DATA_DESCRIPTOR_H_
16 #define SOURCE_FUZZ_DATA_DESCRIPTOR_H_
18 #include <ostream>
19 #include <vector>
21 #include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
23 namespace spvtools {
24 namespace fuzz {
26 // Factory method to create a data descriptor message from an object id and a
27 // list of indices.
28 protobufs::DataDescriptor MakeDataDescriptor(
29 uint32_t object, const std::vector<uint32_t>& indices);
31 // Hash function for data descriptors.
32 struct DataDescriptorHash {
33 size_t operator()(const protobufs::DataDescriptor* data_descriptor) const;
36 // Equality function for data descriptors.
37 struct DataDescriptorEquals {
38 bool operator()(const protobufs::DataDescriptor* first,
39 const protobufs::DataDescriptor* second) const;
42 std::ostream& operator<<(std::ostream& out,
43 const protobufs::DataDescriptor& data_descriptor);
45 } // namespace fuzz
46 } // namespace spvtools
48 #endif // SOURCE_FUZZ_DATA_DESCRIPTOR_H_