Re: Storing !NULL in struct [message #83627 is a reply to message #83531] |
Fri, 15 March 2013 13:40   |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
Hi all,
Not to stir the pot some more, but I actually looked into supporting !null in IDL structures. The deal-killer was that IDL structures are supposed to map directly to C structures. So you can theoretically take an IDL structure, write it out to a file, and then define a corresponding structure in C code and read it into that program. So having a !null field would break that compatibility.
Also, there were major issues of memory management. For named structures, if you allowed !null as a field, and then you decided to assign it a value, you would need to track down every instance of that named structure and re-define it. Even if you only allowed !null for anonymous structures, you could have an array of those structures. If you then defined the !null field in the first structure of the array to have some value, you would have to copy the entire array, and reallocate every structure to have the new value.
In short, it was just too much of a code overhaul and backwards compatibility risk to allow !null in structures.
As Mike suggests, perhaps HASH is the way to go.
Cheers,
Chris
ExelisVIS
|
|
|