[saga-rg] C++ binding: question
Thilo Kielmann
kielmann at cs.vu.nl
Sat Nov 5 12:22:58 CST 2005
The double constructor seem OK to me.
Thilo
On Fri, Nov 04, 2005 at 02:12:38PM -0600, Andre Merzky wrote:
> X-Original-To: kielmann at localhost
> Delivered-To: kielmann at localhost.cs.vu.nl
> Delivered-To: grdfm-saga-rg-outgoing at mailbouncer.mcs.anl.gov
> X-Original-To: grdfm-saga-rg at mailbouncer.mcs.anl.gov
> Delivered-To: grdfm-saga-rg at mailbouncer.mcs.anl.gov
> Date: Fri, 4 Nov 2005 14:12:38 -0600
> From: Andre Merzky <andre at merzky.net>
> To: Simple API for Grid Applications WG <saga-rg at ggf.org>
> Subject: [saga-rg] C++ binding: question
> X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mailbouncer.mcs.anl.gov
> X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mailbouncer.mcs.anl.gov
>
> 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.
>
>
> --
> +-----------------------------------------------------------------+
> | Andre Merzky | phon: +31 - 20 - 598 - 7759 |
> | Vrije Universiteit Amsterdam (VU) | fax : +31 - 20 - 598 - 7653 |
> | Dept. of Computer Science | mail: merzky at cs.vu.nl |
> | De Boelelaan 1083a | www: http://www.merzky.net |
> | 1081 HV Amsterdam, Netherlands | |
> +-----------------------------------------------------------------+
>
--
Thilo Kielmann http://www.cs.vu.nl/~kielmann/
More information about the saga-rg
mailing list