Board index » delphi » How to handle parent class

How to handle parent class

I like to know how you handle situation when you need do something with
instance where variable is defined.

First you have class Ta where is variable b from  class Tb
unit fileTa;
...
uses fileTb;
type
 Ta = class (...)
..
public
 b::Tb
procedure doWhatEverYouWant;
end;
....

Then you  have Tb class
unit FileTb
...
uses fileTa;
type
 Ta = class (...)
..
public
// following rows aint possible because circular reference.
 parent::Ta
 procedure SetFather(f::Ta);
end;

What i want i need to get hands on class Ta and put pointer on client
instance to point to instance which defines it. and i want call
'doWhatEverYouWant' procedure. inside client instance.

 

Re:How to handle parent class


you can specify the UNit that you need  in the implementation section to
avoid the
recirculer ref.
Quote
Jari Kettunen wrote:
> I like to know how you handle situation when you need do something with
> instance where variable is defined.

> First you have class Ta where is variable b from  class Tb
> unit fileTa;
> ...
> uses fileTb;
> type
>  Ta = class (...)
> ..
> public
>  b::Tb
> procedure doWhatEverYouWant;
> end;
> ....

> Then you  have Tb class
> unit FileTb
> ...
> uses fileTa;
> type
>  Ta = class (...)
> ..
> public
> // following rows aint possible because circular reference.
>  parent::Ta
>  procedure SetFather(f::Ta);
> end;

> What i want i need to get hands on class Ta and put pointer on client
> instance to point to instance which defines it. and i want call
> 'doWhatEverYouWant' procedure. inside client instance.

Other Threads