0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-10 22:18:54 +02:00

ircd:Ⓜ️:sync: Add sync item children counter.

This commit is contained in:
Jason Volk 2019-07-06 20:42:45 -07:00
parent 5c8425d047
commit 49264bd13b
2 changed files with 16 additions and 0 deletions

View file

@ -57,6 +57,7 @@ struct ircd::m::sync::item
public:
string_view name() const;
string_view member_name() const;
size_t children() const;
bool poll(data &, const m::event &);
bool linear(data &);

View file

@ -1070,6 +1070,21 @@ catch(const std::bad_function_call &e)
return false;
}
size_t
ircd::m::sync::item::children()
const
{
size_t ret(0);
sync::for_each(this->name(), [&ret]
(auto &item)
{
++ret;
return true;
});
return ret;
}
ircd::string_view
ircd::m::sync::item::member_name()
const