Skip to content
  • Thomas Haller's avatar
    shared: add "shared/nm-glib-aux/nm-value-type.h" · e64fdeea
    Thomas Haller authored
    Glib has GValue which used for boxing value.
    
    Add NMValueType enum, which has a similar purpose, but it's much more
    limited.
    
    - contrary to GValue, the type must be tracked separately from the
      user-data. That is, the "user-data" is only a pointer of appropriate
      type, and the knowledge of the actual NMValueType is kept separately.
      This will be used to have a static list of meta-data that knows the
      value types, but keeping the values independent of this type
      information. With GValue this would not be possible.
    
    - the use case is much more limited. Just support basic integers,
      boolean and strings. Nothing fancy.
    
    Note that we already do something similar at muliple places. See for
    example NMVariantAttributeSpec and nm_utils_team_link_watcher_to_string().
    These could/should instead use NMValueType.
    e64fdeea