[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GT] key and func



Raphael,

Thanks for chiming in. Maybe you could add some more clarification here, as from looking at the code, the $key and $func stuff seems to be just dead code:

Passing key and func values is relevant here:

1. GT::Registry::manage_object

a. Store $key in $obj->{'key'}
b. Add "($key)" to the name of each of the return series

2. GT::Indicators::new

a. Store $func (or a default function) in $self->{'func'}

3. GT::Analyzers::new

a. Store $func (but not a default function) in $self->{'func'}

There is no single place where either key or func are used.

In summary: 

All module creation routines add representing a key if passed in new.
Only Indicators and Analyzers store a function pointer (with or without default)
These are not used.

Could you provide an example of how one would leverage these two entities? It appears to me that this is dead code at this point and should just be removed...

Please advise.

Th.


> -----Original Message-----
> From: Raphael Hertzog [mailto:raphael
AT
geniustrader.org]
> Sent: Monday, March 17, 2008 3:27 AM
> To: devel
AT
geniustrader.org
> Subject: Re: [GT] patches for GT/Systems.pm and GT/Systems/Generic.pm
> 
> On Fri, 14 Mar 2008, Robert A. Schmied wrote:
> > and the similar statement from GT::Signals::Module->new
> >
> > "Create a new signal with the given arguments. $args and $key are
> optional,
> > they are useful for signals which use non-usual input streams."
> 
> IIRC $key is a unique string identifier for the "non-usual input stream"
> and the "non-usual input stream" is represented by the function pointer
> $func used to retrieve data from that stream.
> 
> Cheers,
> --
> Raphaël Hertzog