core/dbus: rework creating numbered D-Bus export path by putting counter into class

I dislike the static hash table to cache the integer counter for
numbered paths. Let's instead cache the counter at the class instance
itself -- since the class contains the information how the export
path should be exported.

However, we cannot use a plain integer field inside the class structure,
because the class is copied between derived classes. For example,
NMDeviceEthernet and NMDeviceBridge both get a copy of the NMDeviceClass
instance. Hence, the class doesn't contain the counter directly, but
a pointer to one counter that can be shared between sibling classes.
This commit is contained in:
Thomas Haller
2018-03-13 10:14:06 +01:00
parent 1e535789cf
commit 57ab9fd60f
17 changed files with 67 additions and 43 deletions

View File

@@ -23,10 +23,6 @@
/*****************************************************************************/
#define NM_EXPORT_PATH_NUMBERED(basepath) ""basepath"/%llu"
/*****************************************************************************/
struct _NMDBusInterfaceInfoExtended;
struct _NMDBusMethodInfoExtended;