Skip to content
  • 's avatar
    o Mark the following functions in Interface as deprecated: tag_create,... · 3d03edf0
    authored
    o Mark the following functions in Interface as deprecated: tag_create, tag_create_variable_length, tag_get_handle( const char*, Tag& )
    o Change all MOAB code that uses above functions to use new tag_get_handle 
    o Fix old test code in MBTest that never ran and would have failed if it did
    o Fix gttool_test always succeeded (never exited with non-zero exit code)
    o Fix mbfacet_test always succeeded (never exited with non-zero exit code)
    o Make MB_TAG_EXCL imply MB_TAG_CREAT for Interface::tag_get_handle
    o Ignore storage type (dense/sparse) if specified for bit tags in Interface::tag_get_handle
    o Match passed default value of zero with a dense tag with no default value because existing code passes that and dense tags kinda have an implicit default of zero.
    o Add flag to Interface::tag_get_handle to skip checking the default value
    
    Rational for changes to tag API:
    
    o One function for both get_handle and create because most code is fine with
      either as long as it gets the desired tag handle
    o Distinction between failure and error: callers can specify arguments to
      tag_get_handle such that either they get back MB_SUCCESS or they cannot
      continue (no more checking for other error codes such as MB_ALREADY_ALLOCATED
      that could also mean success in some cases.)
    o MOAB does type checking for tag when returning an existing tag handle.
    o Sizes specified in number of values rather than number of bytes
    
    Some examples:
    
    OLD: tag_create( name, 4*sizeof(int), MB_TAG_SPARSE, MB_TYPE_INTEGER, handle, NULL, true )
    NEW: tag_get_handle( name, 4, MB_TYPE_INTEGER, handle, MB_TAG_SPARSE|MB_TAG_CREAT )
    
    OLD: tag_get_handle( GLOBAL_ID_TAG_NAME, handle )
    NEW: tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, handle )
    
    OLD: tag_create_variable_length( name, MB_TAG_DENSE, MB_TYPE_HANDLE, handle, def_val, def_val_len*sizeof(EntityHandle) )
    NEW: tag_get_handle( name, def_val_len, MB_TYPE_HANDLE, handle, MB_TAG_DENSE|MB_TAG_VARLEN|MB_TAG_CREAT, def_val )
    
    OLD: tag_create( name, 2, MB_TAG_BIT, MB_TYPE_BIT, handle )
    NEW: tag_get_handle( name, 2, MB_TYPE_BIT, handle, MB_TAG_CREAT )
    
    
    
    git-svn-id: https://svn.mcs.anl.gov/repos/ITAPS/MOAB/trunk@4922 6162379e-bd28-0410-9a7d-b7f4dcfcad3c
    3d03edf0