A 'Map' in DAP4 is an Array in the dataset that is used to provide the domain values for a Coverage (aka a DAP2 Grid). These Maps are a more general case of the DAP2 'Map vectors' because a DAP4 Map can have N dimensions.
Because the Maps can be shared by many of the Arrays in a dataset, they also correspond to the NetCDF/CF notion of a Shared Dimension.
In this implementation of the D4Map, each Map has a name and two weak pointers, one to the Array that holds the domain values and one to the Array that uses the Map. Note that while Maps can be shared by Arrays, each Array has it's own collection of these D4Map objects. This makes processing constraints possible (because it is possible to write different constraints for two arrays that share Maps).
Second try. Including these 'weak' pointers lead to a paradox because the pointers don't exist when making deep copies of the Array. In that case the parent and source Array (the array that holds the Map's data) cannot be found because the Array that holds the Maps does not yet exist. It's being copied and the source object holds pointers to objects that are not reliable - the source Array is being copied because it's maybe going to be deleted!
I removed the parent pointer from the D4Map object and added a pathname to the source Array. So, now we can set either the weak pointer to the source array or the pathname to the source array. The former is used when building the Array (as would be done in a handler) and the latter is used during a deep copy (where even though the pointer to the source Array will soon be invalid, the pathname won't be).
Definition at line 71 of file D4Maps.h.