Mapped Members

Inside Mapped Types, the mapped to Member Modifier can be used to map Methods, Properties, Events, Constructors or Custom Operators to matching members of the "real" underlying class.

This is essentially a shortcut to providing a method body or full read/write statements for the property that would just contain a single statement.

Mapped members may not provide an implementation body:

type
  MyMappedClass = public class mapped to SomeCollection
  public
  
    method Add(o: Object); mapped to addObject(o);
    property Count: Integer; mapped to length;

  end;

The two mapped members shown above would be equivalent to the following two regular implementations:

type
  MyMappedClass = public class mapped to SomeCollection
  public
  
    method Add(o: Object);
    begin
      mapped.addObject(o);
    end;
    
    property Count: Integer read mapped.length write mapped.length;

end;

See Also