1 /* 2 * Copyright 2011, Rene Gollent, rene@gollent.com. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef TYPE_LOOKUP_CONSTRAINTS_H 6 #define TYPE_LOOKUP_CONSTRAINTS_H 7 8 9 #include <String.h> 10 11 #include "Type.h" 12 13 14 class TypeLookupConstraints { 15 public: 16 TypeLookupConstraints(); 17 // no constraints 18 TypeLookupConstraints(type_kind typeKind); 19 // constrain on type only 20 TypeLookupConstraints(type_kind typeKind, 21 int32 subtypeKind); 22 23 bool HasTypeKind() const; 24 bool HasSubtypeKind() const; 25 bool HasBaseTypeName() const; 26 type_kind TypeKind() const; 27 int32 SubtypeKind() const; 28 29 // TODO: This should be further generalized to being able to 30 // pass a full set of constraints for the base type, not just the name 31 const BString& BaseTypeName() const; 32 33 void SetTypeKind(type_kind typeKind); 34 void SetSubtypeKind(int32 subtypeKind); 35 void SetBaseTypeName(const BString& name); 36 37 private: 38 type_kind fTypeKind; 39 int32 fSubtypeKind; 40 bool fTypeKindGiven; 41 bool fSubtypeKindGiven; 42 BString fBaseTypeName; 43 }; 44 45 #endif // TYPE_LOOKUP_CONSTRAINTS_H 46