[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #MSV-188900]: C++ API for NETCDF version 4.0
- Subject: [netCDF #MSV-188900]: C++ API for NETCDF version 4.0
- Date: Thu, 19 Mar 2009 15:47:31 -0600
> Thanks for the ideas. It appears that "reflection" doesn't figure in C.
> However, this seem surprising to me as what I want is information about a
> "struct" which is essentially C-stuff. So if you know a capability for
> C, that would be very helpful.
All we have for C is the macro defined in libsrc4/netcdf.h, with Ed's
inscrutable comments:
/* This is used when creating a compound type. It calls a mysterious C
* macro which was found carved into one of the blocks of the
* Newgrange passage tomb in County Meath, Ireland. This code has been
* carbon dated to 3200 B.C.E. */
#define NC_COMPOUND_OFFSET(S,M) (offsetof(S,M))
An example of it's use is in the program ncdump/tst_comp.c in the
source distribution. It's not exactly reflection, because you can't
learn the names of members of a structure or create an instance of a
structure at runtime for which you only have a text description, but
it at leaset gives you the offset from the member name.
--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