0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-29 04:08:54 +02:00

ircd:Ⓜ️:feds: Add vector of operations to API.

This commit is contained in:
Jason Volk 2019-04-18 15:25:01 -07:00
parent 02bb466898
commit 0edd47d383
3 changed files with 14 additions and 4 deletions

View file

@ -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 &);
};

View file

@ -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
{

View file

@ -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);