Merge pull request #3734 from kumpera/monoclass_reorg
[mono.git] / mono / metadata / class-inlines.h
1 /*
2  * Copyright 2016 Microsoft
3  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
4  */
5 #ifndef __MONO_METADATA_CLASS_INLINES_H__
6 #define __MONO_METADATA_CLASS_INLINES_H__
7
8 #include <mono/metadata/class-internals.h>
9 #include <mono/metadata/tabledefs.h>
10
11 static inline gboolean
12 mono_class_is_def (MonoClass *class)
13 {
14         return class->class_kind == MONO_CLASS_DEF;
15 }
16
17 static inline gboolean
18 mono_class_is_gtd (MonoClass *class)
19 {
20         return class->class_kind == MONO_CLASS_GTD;
21 }
22
23 static inline gboolean
24 mono_class_is_ginst (MonoClass *class)
25 {
26         return class->class_kind == MONO_CLASS_GINST;
27 }
28
29 static inline gboolean
30 mono_class_is_gparam (MonoClass *class)
31 {
32         return class->class_kind == MONO_CLASS_GPARAM;
33 }
34
35 static inline gboolean
36 mono_class_is_array (MonoClass *class)
37 {
38         return class->class_kind == MONO_CLASS_ARRAY;
39 }
40
41 static inline gboolean
42 mono_class_is_pointer (MonoClass *class)
43 {
44         return class->class_kind == MONO_CLASS_POINTER;
45 }
46
47 static inline gboolean
48 mono_class_is_abstract (MonoClass *class)
49 {
50         return mono_class_get_flags (class) & TYPE_ATTRIBUTE_ABSTRACT;
51 }
52
53 static inline gboolean
54 mono_class_is_interface (MonoClass *class)
55 {
56         return mono_class_get_flags (class) & TYPE_ATTRIBUTE_INTERFACE;
57 }
58
59 #endif