Ticket #108 (closed enhancement: fixed)

Opened 10 months ago

Last modified 2 months ago

Change the behaviour of Description constructor

Reported by: regis.lebrun@eads.net Assigned to: conty
Priority: minor Milestone: 2008 work
Component: library Version: 0.11.2
Keywords: Description, Collection Cc:

Description (Last modified by dutka)

Actually, the Description class has two main constructors:

	/** Default constructor */
	Description(const String & name = OT::DefaultName);

	/** Constructor with size */
	Description(UnsignedLong size,
                    const String & name = OT::DefaultName);

but as a Description is a collection of String, it would be much more useful to have the ability to initialize the content of the Description more than the ability to set up its name. We could have:

	/** Default constructor */
	Description(const String & value = OT::DefaultName,
                    const String & name = OT::DefaultName);

	/** Constructor with size */
	Description(const UnsignedLong size,
                    const String & value = OT::DefaultName,
                    const String & name = OT::DefaultName);

that would change the meaning of declarations like

d = Description(1, "distance")

With the current implementation, it means that d is a Description named "distance" with a value equals to the empty String, with the new implementation it means that d is a Description named OT::DefaultName with a value equals to "distance". By the way, it would be possible to write:

d = Description("distance")

As a proper description of the components of a Distribution object is of uttermost importance for all the sensitivity computations (FORM, SORM & Co), we should insure that the creation and the initialization of a Description object is as simple as possible, with a particular attention to Description objects of size 1.

Change History

06/06/08 16:19:26 changed by dutka

  • description changed.

10/23/08 22:29:37 changed by regis.lebrun@eads.net

  • status changed from new to closed.
  • resolution set to fixed.

Ivan already solved most of the ticket. I added a constructor that allows to create a 1D Description from a String. This closes the ticket.

Régis