1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 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. 14 */ 15 16 #ifndef PANDA_VERIFICATION_TYPE_TYPE_PARAMS_H_ 17 #define PANDA_VERIFICATION_TYPE_TYPE_PARAMS_H_ 18 19 #include "type_index.h" 20 21 #include "type_system_kind.h" 22 23 namespace panda::verifier { 24 class TypeParam; 25 class TypeSystem; 26 27 class TypeParams : public TypeParamsIdx { 28 friend class Type; 29 friend class TypeParam; 30 friend class ParametricType; 31 32 public: 33 explicit TypeParams(TypeSystemKind kind, const TypeParamsIdx ¶ms = {}) : TypeParamsIdx {params}, kind_ {kind} {} 34 35 TypeParams() = default; 36 TypeParams(const TypeParams &) = default; 37 TypeParams(TypeParams &&) = default; 38 TypeParams &operator=(const TypeParams &) = default; 39 TypeParams &operator=(TypeParams &&) = default; 40 ~TypeParams() = default; 41 42 bool operator<=(const TypeParams &rhs) const; 43 44 TypeParams &operator>>(const TypeParam &p); 45 46 template <typename Handler> 47 void ForEach(Handler &&handler) const; 48 49 TypeSystem &GetTypeSystem() const; 50 51 private: 52 TypeSystemKind kind_; 53 }; 54 } // namespace panda::verifier 55 56 #endif // PANDA_VERIFICATION_TYPE_TYPE_PARAMS_H_ 57