1185d2cdcSRene Gollent/*
2185d2cdcSRene Gollent * Copyright 2011, Rene Gollent, rene@gollent.com.
3185d2cdcSRene Gollent * Distributed under the terms of the MIT License.
4185d2cdcSRene Gollent */
5185d2cdcSRene Gollent#ifndef TYPE_LOOKUP_CONSTRAINTS_H
6185d2cdcSRene Gollent#define TYPE_LOOKUP_CONSTRAINTS_H
7185d2cdcSRene Gollent
8185d2cdcSRene Gollent
9e5519ef5SRene Gollent#include <String.h>
10e5519ef5SRene Gollent
11185d2cdcSRene Gollent#include "Type.h"
12185d2cdcSRene Gollent
13185d2cdcSRene Gollent
14185d2cdcSRene Gollentclass TypeLookupConstraints {
15185d2cdcSRene Gollentpublic:
16185d2cdcSRene Gollent								TypeLookupConstraints();
17185d2cdcSRene Gollent									// no constraints
18185d2cdcSRene Gollent								TypeLookupConstraints(type_kind typeKind);
19185d2cdcSRene Gollent									// constrain on type only
20185d2cdcSRene Gollent								TypeLookupConstraints(type_kind typeKind,
21185d2cdcSRene Gollent									int32 subtypeKind);
22185d2cdcSRene Gollent
23185d2cdcSRene Gollent		bool					HasTypeKind() const;
24185d2cdcSRene Gollent		bool					HasSubtypeKind() const;
25e5519ef5SRene Gollent		bool					HasBaseTypeName() const;
26185d2cdcSRene Gollent		type_kind				TypeKind() const;
27185d2cdcSRene Gollent		int32					SubtypeKind() const;
28d0123516SRene Gollent
29d0123516SRene Gollent		// TODO: This should be further generalized to being able to
30d0123516SRene Gollent		// pass a full set of constraints for the base type, not just the name
31e5519ef5SRene Gollent		const BString&			BaseTypeName() const;
32185d2cdcSRene Gollent
33185d2cdcSRene Gollent		void					SetTypeKind(type_kind typeKind);
34185d2cdcSRene Gollent		void					SetSubtypeKind(int32 subtypeKind);
35e5519ef5SRene Gollent		void					SetBaseTypeName(const BString& name);
36185d2cdcSRene Gollent
37185d2cdcSRene Gollentprivate:
38185d2cdcSRene Gollent		type_kind				fTypeKind;
39185d2cdcSRene Gollent		int32					fSubtypeKind;
40185d2cdcSRene Gollent		bool					fTypeKindGiven;
41185d2cdcSRene Gollent		bool					fSubtypeKindGiven;
42e5519ef5SRene Gollent		BString					fBaseTypeName;
43185d2cdcSRene Gollent};
44185d2cdcSRene Gollent
45185d2cdcSRene Gollent#endif // TYPE_LOOKUP_CONSTRAINTS_H