Enhanced C#
Language of your choice: library documentation
Public Member Functions | Protected Member Functions | Protected fields | Protected static fields | List of all members
Loyc.WrapperBase< T > Class Template Reference

Abstract class that helps you implement wrappers by automatically forwarding calls to Equals(), GetHashCode() and ToString(). More...


Source file:

Remarks

Abstract class that helps you implement wrappers by automatically forwarding calls to Equals(), GetHashCode() and ToString().

Public Member Functions

override bool Equals (object obj)
 Returns true iff the parameter 'obj' is a wrapper around the same object that this object wraps. More...
 
override int GetHashCode ()
 Returns the hashcode of the wrapped object. More...
 
override string ToString ()
 Returns ToString() of the wrapped object. More...
 

Protected Member Functions

 WrapperBase (T wrappedObject)
 

Protected fields

_obj
 

Protected static fields

static readonly EqualityComparer< T > TComp = EqualityComparer<T>.Default
 

Member Function Documentation

◆ Equals()

override bool Loyc.WrapperBase< T >.Equals ( object  obj)
inline

Returns true iff the parameter 'obj' is a wrapper around the same object that this object wraps.

Parameters
objThe object to compare with the current object.

If obj actually refers to the wrapped object, this method returns false to preserve commutativity of the "Equals" relation.

Referenced by Loyc.WrapperBase< TSet >.Equals().

◆ GetHashCode()

override int Loyc.WrapperBase< T >.GetHashCode ( )
inline

Returns the hashcode of the wrapped object.

◆ ToString()

override string Loyc.WrapperBase< T >.ToString ( )
inline

Returns ToString() of the wrapped object.