mirror of
https://github.com/matrix-construct/construct
synced 2024-09-28 19:58:53 +02:00
ircd:Ⓜ️:feds: Add vector of operations to API.
This commit is contained in:
parent
02bb466898
commit
0edd47d383
3 changed files with 14 additions and 4 deletions
|
@ -35,6 +35,7 @@ namespace ircd::m::feds
|
|||
|
||||
struct ircd::m::feds::acquire
|
||||
{
|
||||
acquire(const vector_view<const opts> &, const closure &);
|
||||
acquire(const opts &, const closure &);
|
||||
};
|
||||
|
||||
|
|
11
ircd/m.cc
11
ircd/m.cc
|
@ -1204,8 +1204,17 @@ ircd::m::app::exists(const string_view &id)
|
|||
|
||||
ircd::m::feds::acquire::acquire(const opts &o,
|
||||
const closure &c)
|
||||
:acquire
|
||||
{
|
||||
using prototype = bool (const opts &, const closure &);
|
||||
vector_view<const opts>{&o, 1}, c
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
ircd::m::feds::acquire::acquire(const vector_view<const opts> &o,
|
||||
const closure &c)
|
||||
{
|
||||
using prototype = bool (const vector_view<const opts> &, const closure &);
|
||||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace ircd::m::feds
|
|||
static bool version(const opts &, const closure &);
|
||||
static bool keys(const opts &, const closure &);
|
||||
|
||||
bool execute(const opts &opts, const closure &closure);
|
||||
bool execute(const vector_view<const opts> &opts, const closure &closure);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
@ -70,10 +70,10 @@ struct ircd::m::feds::request
|
|||
|
||||
bool
|
||||
IRCD_MODULE_EXPORT
|
||||
ircd::m::feds::execute(const opts &opts,
|
||||
ircd::m::feds::execute(const vector_view<const opts> &optsv,
|
||||
const closure &closure)
|
||||
{
|
||||
switch(opts.op)
|
||||
for(const auto &opts : optsv) switch(opts.op)
|
||||
{
|
||||
case op::head: return head(opts, closure);
|
||||
case op::auth: return auth(opts, closure);
|
||||
|
|
Loading…
Reference in a new issue