[Serializable] |
The IDs are unique for the life of the ObjectIDGenerator instance. Generally, an ObjectIDGenerator life lasts as long as the Formatter that created it. Object IDs have meaning only within a given serialized stream, and are used for tracking which objects have references to others within the serialized object graph.
Using a hash table, the ObjectIDGenerator retains what ID is assigned to what object. The object references, which uniquely identify each object, are addresses in the runtime garbage-collected heap. Object reference values can change during serialization, but the table is updated automatically so the information is correct.
ctor #1 | Default constructor. This constructor is called by derived class constructors to initialize state in this type. Initializes a new instance of the ObjectIDGenerator class. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetId | Returns the ID for the specified object, generating a new ID if the specified object has not already been identified by the ObjectIDGenerator. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
HasId | Determines whether an object has already been assigned an ID. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public ObjectIDGenerator(); |
~ObjectIDGenerator(); |
public virtual int GetHashCode(); |
obj
firstTime
Exception Type | Condition |
---|---|
ArgumentNullException | The obj parameter is null. |
SerializationException | The ObjectIDGenerator has been asked to keep track of too many objects. |
public Type GetType(); |
obj
firstTime
Exception Type | Condition |
---|---|
ArgumentNullException | The obj parameter is null. |
protected object MemberwiseClone(); |
public virtual string ToString(); |