1/*
2 * Copyright 2011, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include "TypeLookupConstraints.h"
8
9
10TypeLookupConstraints::TypeLookupConstraints()
11	:
12	fTypeKindGiven(false),
13	fSubtypeKindGiven(false)
14{
15}
16
17
18TypeLookupConstraints::TypeLookupConstraints(type_kind typeKind)
19	:
20	fTypeKind(typeKind),
21	fTypeKindGiven(true),
22	fSubtypeKindGiven(false)
23{
24}
25
26
27TypeLookupConstraints::TypeLookupConstraints(type_kind typeKind,
28	int32 subTypeKind)
29	:
30	fTypeKind(typeKind),
31	fSubtypeKind(subTypeKind),
32	fTypeKindGiven(true),
33	fSubtypeKindGiven(true),
34	fBaseTypeName()
35{
36}
37
38
39bool
40TypeLookupConstraints::HasTypeKind() const
41{
42	return fTypeKindGiven;
43}
44
45
46bool
47TypeLookupConstraints::HasSubtypeKind() const
48{
49	return fSubtypeKindGiven;
50}
51
52
53bool
54TypeLookupConstraints::HasBaseTypeName() const
55{
56	return fBaseTypeName.Length() > 0;
57}
58
59
60type_kind
61TypeLookupConstraints::TypeKind() const
62{
63	return fTypeKind;
64}
65
66
67int32
68TypeLookupConstraints::SubtypeKind() const
69{
70	return fSubtypeKind;
71}
72
73
74const BString&
75TypeLookupConstraints::BaseTypeName() const
76{
77	return fBaseTypeName;
78}
79
80
81void
82TypeLookupConstraints::SetTypeKind(type_kind typeKind)
83{
84	fTypeKind = typeKind;
85	fTypeKindGiven = true;
86}
87
88
89void
90TypeLookupConstraints::SetSubtypeKind(int32 subtypeKind)
91{
92	fSubtypeKind = subtypeKind;
93	fSubtypeKindGiven = true;
94}
95
96
97void
98TypeLookupConstraints::SetBaseTypeName(const BString& name)
99{
100	fBaseTypeName = name;
101}
102