[saga-rg] C++ binding: question
Tom Goodale
goodale at cct.lsu.edu
Fri Nov 4 14:18:33 CST 2005
That's what I was assuming would happen, so I'd say go ahead.
Tom
On Fri, 4 Nov 2005, Andre Merzky wrote:
> Hi all,
>
> here is another question about the C++ language binding we
> stukmbled upon. The API spec says that the session is an
> optional argument to each object creation in SAGA. If the
> session is not given, a default session (theSession) is to
> be associated with the object.
>
> Now, consider a object which has a number of optyional
> parameters already (example not spec conform):
>
> saga::file (string url, mode=saga::file::mode::RO, saga::session s);
>
> If a programmer wants to specify a session, he NEEDS to
> specify mode, and all other optional parameters of the
> constructor. For a programmer who always specifies a
> session that is awkward.
>
> OTOH, a constructor like
>
> saga::file (saga::session s, string url, mode=saga::file::mode::RO);
>
> would giove that programmer the ability to use session and
> rely on parameters defaults, but for another programmer who
> does not use an explicit session it would require to ALWAYS
> specify the session anyway:
>
> saga::file f (theSession, url);
>
>
> The solution we would like to propose is to introduce two
> versions of all constructors:
>
> saga::file ( string url, mode=saga::file::mode::RO);
> saga::file (saga::session s, string url, mode=saga::file::mode::RO);
>
> which would accomodate both use cases nicely. To be sure:
> that affects only the C++ language bindings - that might
> look totally different for other languages.
>
> Any comments? If not, we go for the proposed solution...
>
> Cheers, Andre.
>
>
>
More information about the saga-rg
mailing list