[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #MSV-188900]: C++ API for NETCDF version 4.0



Lynton,

> I am busy truing out the cxx4 (c++) interface. So far I'm pretty
> impressed. Most of the code appears to be present and correct, but it is
> a case of going stedaily through. I will need to modify some
> documentation and code.

That's great to hear!

> Have two specific queries.
>
> (1) Why in the constructor for NcVar (see attached file), is "id" passed
> in. This parameter is used in readOnly mode and appears to override the
> output of nc_dev_var. It appears to me that this is a cludge. If this
> must be retained, then I propose to make another constructor with one
> less argument (ie "id" missed out).

I agree with you that id should not be an argument to the NcVar constructor.
I don't know why it was included, but you should feel free to omit it.  We
have no backward compatibility commitment for the cxx4 API, as we have said
it's experimental and incomplete.

> (2) In C++ programmes I have been developing I have made extensive use
> of the C++ (multi-)dimensional array C++ template class library. Have
> you considered using this. It could make the C++ API more
> straightforward.

Yes, please use the multidimensional array class from the standard template
library.  And if there are other comatiners from the standard template
library that look like they would be useful, I'm in favor of using them too.
For example, I think there's a good smart pointer class that may be useful
for avoiding memory leaks and making garbage collection easier.

> All the best

Thanks!

--Russ

> Lynton
>
> -----Original Message-----
> From: Unidata netCDF Support [mailto:address@hidden]
> Sent: 10 March 2009 16:01
> To: Appel, Lynton
> Cc: address@hidden; Storrs, John; Shibaev, Sergei;
> Muir, David G.; Akers, Rob
> Subject: [netCDF #MSV-188900]: C++ API for NETCDF version 4.0
>
>
> Lynton,
>
> > Thanks for the reply.  I had been looking at the cxx directory, not
> > the cxx4 directory. I see the cxx4 directory appears to have some of
> > the features missing in cxx. Do you advise to work from this?
>
> Yes, at least if that seems practical.  When you run the configure
> script to build, check, and install netCDF, including the configure
> option --enable-cxx-4 will cause the cxx4 directory to be used after the
> cxx directory for building.  I just tried it and noticed a portability
> problem in cxx4/ncatt.cpp that prevents me from testing it, but it looks
> like it would be easy to fix (it assumes "__FUNCTION__" is a predefined
> macro that identifies the current function, used in error messages
> constructed when an exception is thrown, e.g. see cxx4/ncatt.cpp line 44
> or line 53).
>
> Ed Hartnett was overseeing the summer project to implement this C++
> netCDF-4 interface, so he knows more about what didn't get completed and
> where work is most needed.  It may already implement enough of the
> netCDF-4 interface that you won't need to do much, depending on your
> requirements.  I'll CC: Ed on this message in case he wants to add
> comments on this issue.
>
> We would really appreciate any contributions you could make to improving
> this C++ netCDF-4 implementation, even if it's only an objective
> evaluation of what's there and a recommendation for how practical it
> will be to complete or how much effort it will take.  Bug fixes will
> also be gratefully accepted.
>
> > I presume  (please tell me otherwise!) that I will NOT need to
> > transfer stuff from cxx into cxx4.
>
> I think that's right, but Ed may have made some additions to the cxx
> sources since the cxx4 sources were written, so I'll let him provide the
> definitive answer to that question.
>
> > Are you happy not to make calls to nc__open? I see that the cxx4 uses
> > nc_open but has retained in its API a chunk size pointer.
>
> The calls to nc__open were only made to set some infrequently used
> tuning
> parameters for the netCDF-3 files (because the netCDF-4 library is fully
> compatible with netCDF-3 and can create netCDF-3 classic files as well
> as netCDF-4/HDF5 files).  I have renamed the "chunksize" pointer to a
> "bufrsize" pointer in our next release, to avoid confusion with the
> variable chunking and chunk sizes supported in netCDF-4, which are
> unrelated to this bufrsize parameter used for performance tuning.
>
> > I think my work will be  mainly to tidy up the cxx4 API and make sure
> > it is working for me. I can add documentation also.
>
> That would be great!  I hope you find it usable, but if not, please let
> us know where it needs work.  Thanks!
>
> > Any advice will of course be useful.
>
> We'll be happy to tell you what we know ...
>
> --Russ
>
> Russ Rew                                         UCAR Unidata Program
> address@hidden                     http://www.unidata.ucar.edu
>
>
>
> Ticket Details
> ===================
> Ticket ID: MSV-188900
> Department: Support netCDF
> Priority: Normal
> Status: Closed
>
>
>
> Click
> https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg==
> XIEYDtKX5tURfJQDfa1KkQ8A5jVWrdCDUM7tgCviQCIXg==  to report this email as
> spam.
>
>
> This message has been scanned for viruses by BlackSpider MailControl -
www.blackspider.com
>
>

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: MSV-188900
Department: Support netCDF
Priority: Normal
Status: Closed