2002-01-04 Ravi Pratap <ravi@ximian.com>
[mono.git] / mcs / class / corlib / System / ValueType.cs
1 //
2 // System.ValueType.cs
3 //
4 // Author:
5 //   Miguel de Icaza (miguel@ximian.com)
6 //
7 // (C) Ximian, Inc.  http://www.ximian.com
8 //
9
10 namespace System {
11         
12         public abstract class ValueType {
13
14                 // <summary>
15                 //   ValueType constructor
16                 // </summary>
17                 protected ValueType ()
18                 {
19                 }
20
21                 // <summary>
22                 //   True if this instance and o represent the same type
23                 //   and have the same value.
24                 // </summary>
25                 [TODO]
26                 public override bool Equals (object o)
27                 {
28                         if (o == null)
29                                 throw new ArgumentNullException ();
30
31                         if (o.GetType() != this.GetType())
32                                 return false;
33
34                         // TODO:
35                         //   Now implement bit compare here.
36                         
37                         // TODO: Implement me!
38                         return false;
39                 }
40
41                 // <summary>
42                 //   Gets a hashcode for this value type using the
43                 //   bits in the structure
44                 // </summary>
45                 [TODO]
46                 public override int GetHashCode ()
47                 {
48                         if (this == null)
49                                 return 0;
50
51                         // TODO: compute a hashcode based on the actual
52                         // contents.
53
54                         return 0;
55                 }
56
57                 // <summary>
58                 //   Stringified representation of this ValueType.
59                 //   Must be overriden for better results, by default
60                 //   it just returns the Type name.
61                 // </summary>
62                 public override string ToString ()
63                 {
64                         return GetType().FullName;
65                 }
66         }
67 }