0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-15 14:31:11 +01:00

ircd:Ⓜ️ Add count() interface to room::state.

This commit is contained in:
Jason Volk 2018-02-24 19:52:02 -08:00
parent 4818409b51
commit 191167f7ba
2 changed files with 18 additions and 0 deletions

View file

@ -188,6 +188,10 @@ struct ircd::m::room::state
bool test(const event::id::closure_bool &view) const; bool test(const event::id::closure_bool &view) const;
bool test(const event::closure_bool &view) const; bool test(const event::closure_bool &view) const;
// Counting / Statistics
size_t count(const string_view &type) const;
size_t count() const;
// Existential // Existential
bool has(const string_view &type, const string_view &state_key) const; bool has(const string_view &type, const string_view &state_key) const;
bool has(const string_view &type) const; bool has(const string_view &type) const;

View file

@ -427,6 +427,20 @@ const
}); });
} }
size_t
ircd::m::room::state::count()
const
{
return m::state::count(root_id);
}
size_t
ircd::m::room::state::count(const string_view &type)
const
{
return m::state::count(root_id, type);
}
bool bool
ircd::m::room::state::test(const event::closure_bool &closure) ircd::m::room::state::test(const event::closure_bool &closure)
const const