coolfluid / coolfluid3

COOLFluiD is a collaborative simulation environment focused on complex multi-physics simulations
http://coolfluid.github.com
76 stars 77 forks source link

clear() method for Component #230

Closed barche closed 12 years ago

barche commented 12 years ago

Similar to std containers, it would be nice to provide a "clear()" function for components, which removes all children from a component. I'm needing this in UFEM, when an new set of sub-actions is created based on an option change.

wdeconinck commented 12 years ago

Sounds good idea! Clearing should also set options to default. In effect the same as recreating the component.

On 20 Aug 2012, at 11:14, Bart Janssens notifications@github.com wrote:

Similar to std containers, it would be nice to provide a "clear()" function for components, which removes all children from a component. I'm needing this in UFEM, when an new set of sub-actions is created based on an option change.

— Reply to this email directly or view it on GitHub.

tlmquintino commented 12 years ago

Sounds good to me, but clearing and setting defaults should not be the same method. How about making it ... clear() reset_to_defaults() or options_defaults()

this way the client code has better control on what to do. I suppose Bart does not want to fully reconfigure the component.

Tiago (enjoying summer sun in Portugal)

On 20 Aug 2012, at 12:29, Willem Deconinck wrote:

Sounds good idea! Clearing should also set options to default. In effect the same as recreating the component.

On 20 Aug 2012, at 11:14, Bart Janssens notifications@github.com wrote:

Similar to std containers, it would be nice to provide a "clear()" function for components, which removes all children from a component. I'm needing this in UFEM, when an new set of sub-actions is created based on an option change.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub.

barche commented 12 years ago

Yes, I agree, removing children and resetting options might not always need to be done together, in my case I want the options to remain untouched.

clear() and reset_options() methods are now in main, together with the related signals.