ToString

The Hash aspect can be used in cross-platform code to mark the method that returns a unique hash for the object.

Using this attribute makes it easier to implement this common method in cross-platform code, despite the fact that the different platforms expect slightly different naming conventions (GetHashHash on .NET and Island, hashCode on Java and hash on Cocoa).

A single method on a class that takes no parameters and returns an Integer may be annotated with the aspect, and the compiler will automatically adjust it internally to implement the appropriate method for each platform.

[Hash]
method NameDoesNotMatter: Integer;
begin
  ...
end;
[Hash]
public int NameDoesNotMatter()
{
    ...
}
@Hash
public func NameDoesNotMatter() -> Int {
    ...
}
@Hash
public int NameDoesNotMatter()
{
    ...
}

Defined in RemObjects.Elements.Cirrus.dll

See Also