File: TargetMember.cs

package info (click to toggle)
mono-debugger 0.60%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 9,556 kB
  • ctags: 22,787
  • sloc: ansic: 99,407; cs: 42,429; sh: 9,192; makefile: 376
file content (149 lines) | stat: -rw-r--r-- 3,585 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
using System;

namespace Mono.Debugger.Languages
{
	[Serializable]
	public abstract class TargetMemberInfo : DebuggerMarshalByRefObject
	{
		public readonly TargetType Type;
		public readonly string Name;
		public readonly int Index;
		public readonly bool IsStatic;

		protected TargetMemberInfo (TargetType type, string name, int index, bool is_static)
		{
			this.Type = type;
			this.Name = name;
			this.Index = index;
			this.IsStatic = is_static;
		}

		protected abstract string MyToString ();

		public override string ToString ()
		{
			return String.Format ("{0} ({1}:{2}:{3}:{4})",
					      GetType (), Type, Index, IsStatic, MyToString ());
		}
	}

	[Serializable]
	public abstract class TargetEnumInfo : TargetMemberInfo
	{
		public readonly bool HasConstValue;

		protected TargetEnumInfo (TargetType type, string name, int index, bool is_static,
					  int position, int offset, bool has_const_value)
			: base (type, name, index, is_static)
		{
			this.HasConstValue = has_const_value;
		}

		public abstract object ConstValue {
			get;
		}

		protected override string MyToString ()
		{
			return String.Format ("{0}:{1}", Type, HasConstValue);
		}
	}

	[Serializable]
	public abstract class TargetFieldInfo : TargetMemberInfo
	{
		public readonly int Offset;
		public readonly int Position;
		public readonly bool HasConstValue;

		protected TargetFieldInfo (TargetType type, string name, int index, bool is_static,
					   int position, int offset, bool has_const_value)
			: base (type, name, index, is_static)
		{
			this.Position = position;
			this.Offset = offset;
			this.HasConstValue = has_const_value;
		}

		public abstract object ConstValue {
			get;
		}

		protected override string MyToString ()
		{
			return String.Format ("{0}:{1}:{2}", Type, Offset, HasConstValue);
		}
	}

	[Serializable]
	public abstract class TargetPropertyInfo : TargetMemberInfo
	{
		public readonly TargetFunctionType Getter;
		public readonly TargetFunctionType Setter;

		protected TargetPropertyInfo (TargetType type, string name, int index,
					      bool is_static, TargetFunctionType getter,
					      TargetFunctionType setter)
			: base (type, name, index, is_static)
		{
			this.Getter = getter;
			this.Setter = setter;
		}

		public bool CanRead {
			get { return Getter != null; }
		}

		public bool CanWrite {
			get { return Setter != null; }
		}

		protected override string MyToString ()
		{
			return String.Format ("{0}:{1}", Getter, Setter);
		}
	}

	[Serializable]
	public abstract class TargetEventInfo : TargetMemberInfo
	{
		public readonly TargetFunctionType Add;
		public readonly TargetFunctionType Remove;
		public readonly TargetFunctionType Raise;

		protected TargetEventInfo (TargetType type, string name, int index,
					   bool is_static, TargetFunctionType add,
					   TargetFunctionType remove, TargetFunctionType raise)
			: base (type, name, index, is_static)
		{
			this.Add = add;
			this.Remove = remove;
			this.Raise = raise;
		}

		protected override string MyToString ()
		{
			return String.Format ("{0}:{1}:{2}", Add, Remove, Raise);
		}
	}

	[Serializable]
	public abstract class TargetMethodInfo : TargetMemberInfo
	{
		public readonly string FullName;
		public new readonly TargetFunctionType Type;

		protected TargetMethodInfo (TargetFunctionType type, string name, int index,
					    bool is_static, string full_name)
			: base (type, name, index, is_static)
		{
			this.Type = type;
			this.FullName = full_name;
		}

		protected override string MyToString ()
		{
			return String.Format ("{0}", FullName);
		}
	}
}