lib/dbus/ReadIter: add ForEachRecurse()
This commit is contained in:
parent
d4141bf7f1
commit
fbfbc5682a
|
@ -70,8 +70,8 @@ template<typename F>
|
||||||
inline void
|
inline void
|
||||||
ForEachInterface(ReadMessageIter &&i, F &&f)
|
ForEachInterface(ReadMessageIter &&i, F &&f)
|
||||||
{
|
{
|
||||||
i.ForEach(DBUS_TYPE_DICT_ENTRY, [&f](auto &&j){
|
i.ForEachRecurse(DBUS_TYPE_DICT_ENTRY, [&f](auto &&j){
|
||||||
RecurseInterfaceDictEntry(j.Recurse(), f);
|
RecurseInterfaceDictEntry(std::move(j), f);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,17 @@ public:
|
||||||
for (; GetArgType() == arg_type; Next())
|
for (; GetArgType() == arg_type; Next())
|
||||||
f(*this);
|
f(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper for ForEach() which passes a recursed iterator for
|
||||||
|
* each element.
|
||||||
|
*/
|
||||||
|
template<typename F>
|
||||||
|
void ForEachRecurse(int arg_type, F &&f) {
|
||||||
|
ForEach(arg_type, [&f](auto &&i){
|
||||||
|
f(i.Recurse());
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace ODBus */
|
} /* namespace ODBus */
|
||||||
|
|
Loading…
Reference in New Issue