[NeXus-tech] NeXus API and large arrays
freddie.akeroyd at stfc.ac.uk
freddie.akeroyd at stfc.ac.uk
Mon Oct 17 15:04:08 BST 2011
Hi Pete,
I was only referring to the core NeXus API below which has traditionally been a C compatible API - I think it would be best to keep this compatibility and so using function overloading would not be possible there; however the NeXus C++ binding layered on top of the core API would be able to take advantage of function overloading.
Regards,
Freddie
> -----Original Message-----
> From: nexus-tech-bounces at nexusformat.org [mailto:nexus-tech-
> bounces at nexusformat.org] On Behalf Of Peterson, Peter F.
> Sent: 17 October 2011 14:30
> To: NeXus Technical sub-committee list
> Subject: Re: [NeXus-tech] NeXus API and large arrays
>
> Why wouldn't you just overload the existing functions with the versions
> that take hsize_t (or int64_t) as their type? If somebody calls these
> functions with something ambiguous the compiler will complain and they
> will have to cast in order to resolve it.
>
> P^2
>
> On Oct 17, 2011, at 6:20 AM, <freddie.akeroyd at stfc.ac.uk> wrote:
>
> > Hi,
> >
> > We have managed to create a rather large (>2 billion elements) one
> dimensional array on one of our instruments - this has caused issues
> with the NeXus API as the functions dealing with array dimensions are
> all signed 32bit integers. I have worked around this in the local
> implementation, but was wondering if some additions to the NeXus API
> would be the best solution for the future (in this particular case I
> intend to try and split data before it gets to this point in future,
> but I'm sure a similar situation could arise again elsewhere)
> >
> > HDF5 uses hsize_t internally for array dimension, which is an
> unsigned 64bit type - my suggestion is that we create a set of new
> NeXus API functions handling "int64_t" dimensions (I suggest this
> rather than uint64_t as NX_UNLIMITED is -1 and I'm always a little
> cautious about casting negative numbers to unsigned). As for naming
> these functions, how about adding "64" to the end of the function name?
> >
> > The main functions that would need adding are:
> >
> > NXputslab64
> > NXgetslab64
> > NXgetinfo64
> > NXgetrawinfo64
> >
> > The following should probably be added too for completeness:
> > NXmakedata64
> > NXcompmakedata64
> > NXmalloc64
> >
> > Regards,
> >
> > Freddie
> >
> > --
> > Scanned by iCritical.
> >
> > _______________________________________________
> > NeXus-tech mailing list
> > NeXus-tech at nexusformat.org
> > hxxp://lists.nexusformat.org/mailman/listinfo/nexus-tech
>
>
> _______________________________________________
> NeXus-tech mailing list
> NeXus-tech at nexusformat.org
> http://lists.nexusformat.org/mailman/listinfo/nexus-tech
--
Scanned by iCritical.
More information about the NeXus-tech
mailing list