diff options
author | Thomas Haller <thaller@redhat.com> | 2019-05-10 10:09:54 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-05-23 18:09:49 +0200 |
commit | e64fdeeaf6d06ddc5e0d5363db0265742fe49144 (patch) | |
tree | 0556b07a6b9416bb8eb87badf927c9b0ff92e998 /shared | |
parent | efccc2a53c3288034d1bd3809c9ee52fa98604c9 (diff) | |
download | NetworkManager-e64fdeeaf6d06ddc5e0d5363db0265742fe49144.tar.gz |
shared: add "shared/nm-glib-aux/nm-value-type.h"
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.
Diffstat (limited to 'shared')
-rw-r--r-- | shared/nm-glib-aux/nm-value-type.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-value-type.h b/shared/nm-glib-aux/nm-value-type.h new file mode 100644 index 0000000000..b5d2bea5e6 --- /dev/null +++ b/shared/nm-glib-aux/nm-value-type.h @@ -0,0 +1,23 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2019 Red Hat, Inc. + */ + +#ifndef __NM_VALUE_TYPE_H__ +#define __NM_VALUE_TYPE_H__ + +#endif /* __NM_VALUE_TYPE_H__ */ |