[MOAB-dev] ***NOTE*** MBInterface::load_file API change

Jason Kraftcheck kraftche at cae.wisc.edu
Fri Nov 13 15:25:59 CST 2009


Jed Brown wrote:
> Jason Kraftcheck wrote:
>> In check-in r3343, I changed the signature of MBInterface::load_file in such
>> a way that it will break any existing code outside of MOAB that is calling
>> that function.
>>
>> MOAB no longer creates an entity set for each file read operation.  Thus
>> load_file had to change because the previously required reference to an
>> MBEntityHandle via which that entity set was returned to the caller no
>> longer makes sense.  Instead, load_file accepts a "const MBEntityHandle*"
>> which may be, and defaults to, NULL.  To obtain the previous behavior of
>> having the contents of the file placed in an entity set, the caller must
>> *create* an entity set and pass in the address of the handle.
> 
> The only reason this is a const pointer instead of a value is so that
> you can pass NULL?  If you pass NULL, doesn't everything just go into
> the root set?  Why not actually use the root set for this purpose?  (I
> know it's merely cosmetic, but it looks peculiar.)
> 

I was deliberately trying to break existing code so that any code that was
relying on MBInterface::load_file to create the entity set would not
continue to compile but use an uninitialized handle value.

- jason



More information about the moab-dev mailing list