[Clam-devel] Re: control init param 'published' and MIDIKeyboard

David García Garzón dgarcia at iua.upf.edu
Wed Nov 26 05:34:49 PST 2008


I just found this piece of documentation in InControlTemplate constructor:

/**
* Constructor of the InControlTmpl with a member-service-function associated.
* @param publish This flag (true by default) concerns the publication of the
* control pointer at the base processing object.
* <b>Important:</b> notice that if the out control object is going to suffer a 
copy
* (i.e.creating controls that will be copied inside an STL container)
* the original pointer published will be no longer . For avoiding this
* case we recommend using the flag publish=true. And invoke the 
PublishInControl
* method of the processing object, once the copy is made.
* @param f The member function that will act as a service funtion each time
* the DoControl method is invoqued.
* @parent The processing object that owns the control object. The one where
* to publish the control if it is the case (publish flag set)
*/

I guess that "For avoiding this case we recommend using the flag 
publish=true." is a typo that wanted to mean publish=false, even though is not 
the case of MIDIKeyboard as it is not using any stl container and the ones 
that get published appart are OutControls while the ones that received 
published=false are the InControls. Puzzling.

Any way, for the case that the doxygen documentation talks about, i wouldn't 
use a container of controls but a container of pointers to controls. Maybe we 
should privatize the copy constructor and the assignment operator to avoid 
that use.


El Wednesday 26 November 2008 10:58:39 David García Garzón va escriure:
> I am doing some simplifications on the control constructor parameters to
> see whether an alternative solution for callback controls fits. Some of the
> last commits i did were related to remove the 'published' parameter for
> InControls constructor. When false, the parameter made the control no to be
> registered in the container processing even if you specify one. It was true
> by default and just one class set it to false MIDIKeyboard, not event the
> tests.
>
> The problem is that I don't even understand how such class MIDIKeyboard
> should be used as it does a weird use of controls. By now what I did is
> just not providing a parent processing so that it is not published. I would
> thank any clarification from the authors if they are still around.

-- 
David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
http://www.iua.upf.edu/~dgarcia





More information about the clam-devel mailing list