Re: [fpc-pascal] how to determine if a class has descendant registered within the current program

2017-03-08 Thread Graeme Geldenhuys
On 2017-03-08 11:43, Michael Van Canneyt wrote:
> Not really, because the list depends on a compiled binary. 
> There is no binary when generating documentation...

Ah, okay.


> The good news is that the documentation can already do this without any 
> changes to the compiler; if so desired, it could generate a list of all 
> descendents in the package.

Indeed, I knew this would already be possible. I simply thought the RTTI
option might be a bit more efficient.


Regards,
  Graeme

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] how to determine if a class has descendant registered within the current program

2017-03-08 Thread Michael Van Canneyt



On Wed, 8 Mar 2017, Graeme Geldenhuys wrote:


On 2017-03-08 10:55, Michael Van Canneyt wrote:
Currently not, but I think that Sven Barth will implement something 
for the new RTTI which will make this possible in the future.


That should be handy for the class documentation too, being able to list
all descendants of a class (much like Java's JavaDoc does).


Not really, because the list depends on a compiled binary. 
There is no binary when generating documentation...


The good news is that the documentation can already do this without any 
changes to the compiler; if so desired, it could generate a list of all 
descendents in the package.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] how to determine if a class has descendant registered within the current program

2017-03-08 Thread Graeme Geldenhuys
On 2017-03-08 10:55, Michael Van Canneyt wrote:
> Currently not, but I think that Sven Barth will implement something 
> for the new RTTI which will make this possible in the future.

That should be handy for the class documentation too, being able to list
all descendants of a class (much like Java's JavaDoc does).

Regards,
  Graeme

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] how to determine if a class has descendant registered within the current program

2017-03-08 Thread Michael Van Canneyt



On Wed, 8 Mar 2017, Dennis wrote:

I have a many classes, one inherits from another one, in an ancestor 
method, I want to test whether the calling class is a childless class.


e.g.
class function TAncestor.GetCaption : String; //virtual
begin
if HasChild then
  result := 'something'
  else
result := 'something else';

end;


where HasChild is a boolean class function that tells me whether the 
current calling class has children defined or now.


Is that possible?


Currently not, but I think that Sven Barth will implement something 
for the new RTTI which will make this possible in the future.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal