Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-11

fpdoc / methods/properties in inherited

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin

Another question

Asume the following

type
  TListBase = class
  protected
    Procedure SetFoo(AValue: TFoo) ; virtual; abstract;
    Function GetFoo: TFoo ; virtual; abstract;
  public
    property Foo read GetFoo write SetFoo;
  end;
  TListSpecific = class(TListBase)
  protected
    Procedure SetFoo(AValue: TFoo) ; override;
    Function GetFoo: TFoo ; override;
  end;

In TListSpecific the property Foo may have additional behaviour (and it may differ from other subclassses. However, I found no way, to document the property in the inherited class, differently from the base class. Of course no one can ever reach this by pressing F1 in the source, because there is no property declaration on whcih click F1.

But it could be referred to, by other classes:

  TOther = Class
  public
     property List: TlistSpecific;
     property ListFoo: TFoo;
  end

Now in the documentation of TOther.ListFoo there may be a reason to link/seealso to TListSpecific.Foo.

Reply by email

Mattias Gaertner
to Martin
Show quoted text 24 lines
Another question Asume the following type TListBase = class protected Procedure SetFoo(AValue: TFoo) ; virtual; abstract; Function GetFoo: TFoo ; virtual; abstract; public property Foo read GetFoo write SetFoo; end; TListSpecific = class(TListBase) protected Procedure SetFoo(AValue: TFoo) ; override; Function GetFoo: TFoo ; override; end; In TListSpecific the property Foo may have additional behaviour (and it may differ from other subclassses. However, I found no way, to document the property in the inherited class, differently from the base class. Of course no one can ever reach this by pressing F1 in the source, because there is no property declaration on whcih click F1.

You can add

  public
    property Foo;

and document that.

Show quoted text 10 lines
But it could be referred to, by other classes: TOther = Class public property List: TlistSpecific; property ListFoo: TFoo; end Now in the documentation of TOther.ListFoo there may be a reason to link/seealso to TListSpecific.Foo.

Mattias

Reply by email