Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

[netcdfgroup] NcFile as class member

I'm sure this has been asked before, but I cannot find it in the archives.
I cannot seem to use an NcFile object as a class member. If I do the
following (shortened for clarity), I get a NcBadId exception:

class Trync
{
public:
    Trync()
    {
        fooFile = NcFile("foo.nc",NcFile::replace);
        int a = 1;
        fooFile.putAtt("bar", ncInt, size_t(1), &a);
    }

    NcFile fooFile;
};

int main()
{
    Trync tnc;
    return 0;
}


To be clear, the exception happens even without the putAtt command. It just
happens during the destruction of fooFile. I've looked at the definition of
operator=() and it does seem to correctly copy myId from its rhs. Does
anybody know what's going on, and is there a workaround?

Thanks
  • 2014 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: