mirror of
https://github.com/matrix-construct/construct
synced 2024-11-24 15:52:34 +01:00
ircd:Ⓜ️:room::events: Move nested interfaces out to room::.
This commit is contained in:
parent
4e209855de
commit
d28d3d8084
11 changed files with 41 additions and 42 deletions
|
@ -21,10 +21,6 @@
|
|||
///
|
||||
struct ircd::m::room::events
|
||||
{
|
||||
struct sounding;
|
||||
struct missing;
|
||||
struct horizon;
|
||||
|
||||
static conf::item<ssize_t> viewport_size;
|
||||
|
||||
m::room room;
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
#define HAVE_IRCD_M_ROOM_EVENTS_HORIZON_H
|
||||
#define HAVE_IRCD_M_ROOM_HORIZON_H
|
||||
|
||||
/// Find missing room events. This is an interface to the event-horizon for
|
||||
/// this room. The event horizon is keyed by event_id and the value is the
|
||||
/// event::idx of the event referencing it. There can be multiple entries for
|
||||
/// an event_id. The closure is also invoked with the depth of the referencer.
|
||||
///
|
||||
struct ircd::m::room::events::horizon
|
||||
struct ircd::m::room::horizon
|
||||
{
|
||||
using closure = util::function_bool
|
||||
<
|
|
@ -9,7 +9,7 @@
|
|||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
#define HAVE_IRCD_M_ROOM_EVENTS_MISSING_H
|
||||
#define HAVE_IRCD_M_ROOM_MISSING_H
|
||||
|
||||
/// Find missing room events. This is a breadth-first iteration of missing
|
||||
/// references from the tophead (or at the event provided in the room arg)
|
||||
|
@ -18,7 +18,7 @@
|
|||
/// to the server, followed by the depth and event::idx of the event making the
|
||||
/// reference.
|
||||
///
|
||||
struct ircd::m::room::events::missing
|
||||
struct ircd::m::room::missing
|
||||
{
|
||||
using closure = util::function_bool
|
||||
<
|
|
@ -112,6 +112,9 @@ namespace ircd::m
|
|||
struct ircd::m::room
|
||||
{
|
||||
struct events;
|
||||
struct missing;
|
||||
struct horizon;
|
||||
struct sounding;
|
||||
struct state;
|
||||
struct members;
|
||||
struct origins;
|
||||
|
@ -189,9 +192,9 @@ struct ircd::m::room
|
|||
};
|
||||
|
||||
#include "events.h"
|
||||
#include "events_sounding.h"
|
||||
#include "events_missing.h"
|
||||
#include "events_horizon.h"
|
||||
#include "sounding.h"
|
||||
#include "missing.h"
|
||||
#include "horizon.h"
|
||||
#include "state.h"
|
||||
#include "state_space.h"
|
||||
#include "state_history.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
#define HAVE_IRCD_M_ROOM_EVENTS_SOUNDING_H
|
||||
#define HAVE_IRCD_M_ROOM_SOUNDING_H
|
||||
|
||||
// The "viewport" is comprised of events starting from the tophead (most recent
|
||||
// in room timeline) and covering about ~20 events leading up to that. Note
|
||||
|
@ -44,7 +44,7 @@ namespace ircd::m
|
|||
/// to calculate backfill requests, etc. This interface is depth-first oriented,
|
||||
/// rather than the breadth-first room::missing interface.
|
||||
///
|
||||
struct ircd::m::room::events::sounding
|
||||
struct ircd::m::room::sounding
|
||||
{
|
||||
using range = std::pair<int64_t, int64_t>;
|
||||
using closure = util::function_bool
|
|
@ -109,9 +109,9 @@ libircd_matrix_la_SOURCES += room_aliases.cc
|
|||
libircd_matrix_la_SOURCES += room_bootstrap.cc
|
||||
libircd_matrix_la_SOURCES += room_create.cc
|
||||
libircd_matrix_la_SOURCES += room_events.cc
|
||||
libircd_matrix_la_SOURCES += room_events_sounding.cc
|
||||
libircd_matrix_la_SOURCES += room_events_missing.cc
|
||||
libircd_matrix_la_SOURCES += room_events_horizon.cc
|
||||
libircd_matrix_la_SOURCES += room_sounding.cc
|
||||
libircd_matrix_la_SOURCES += room_missing.cc
|
||||
libircd_matrix_la_SOURCES += room_horizon.cc
|
||||
libircd_matrix_la_SOURCES += room_head.cc
|
||||
libircd_matrix_la_SOURCES += room_head_fetch.cc
|
||||
libircd_matrix_la_SOURCES += room_state_fetch.cc
|
||||
|
|
|
@ -164,7 +164,7 @@ ircd::m::acquire::fetch_history(event::idx &ref_min)
|
|||
if(size_t(depth_range.second - depth_range.first) < opts.viewport_size)
|
||||
depth_range.first -= std::min(long(opts.viewport_size), depth_range.first);
|
||||
|
||||
m::room::events::missing missing
|
||||
m::room::missing missing
|
||||
{
|
||||
opts.room
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace ircd::m::dbs
|
|||
}
|
||||
|
||||
size_t
|
||||
ircd::m::room::events::horizon::rebuild()
|
||||
ircd::m::room::horizon::rebuild()
|
||||
{
|
||||
m::dbs::opts opts;
|
||||
opts.appendix.reset();
|
||||
|
@ -54,7 +54,7 @@ ircd::m::room::events::horizon::rebuild()
|
|||
}
|
||||
|
||||
size_t
|
||||
ircd::m::room::events::horizon::count()
|
||||
ircd::m::room::horizon::count()
|
||||
const
|
||||
{
|
||||
size_t ret{0};
|
||||
|
@ -69,7 +69,7 @@ const
|
|||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::events::horizon::for_each(const closure &closure)
|
||||
ircd::m::room::horizon::for_each(const closure &closure)
|
||||
const
|
||||
{
|
||||
const std::function<bool (const string_view &)> in_room
|
|
@ -9,7 +9,7 @@
|
|||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
size_t
|
||||
ircd::m::room::events::missing::count()
|
||||
ircd::m::room::missing::count()
|
||||
const
|
||||
{
|
||||
size_t ret{0};
|
||||
|
@ -24,15 +24,15 @@ const
|
|||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::events::missing::for_each(const closure &closure)
|
||||
ircd::m::room::missing::for_each(const closure &closure)
|
||||
const
|
||||
{
|
||||
return for_each({0L, 0L}, closure);
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::events::missing::for_each(const pair<int64_t> &depth,
|
||||
const closure &closure)
|
||||
ircd::m::room::missing::for_each(const pair<int64_t> &depth,
|
||||
const closure &closure)
|
||||
const
|
||||
{
|
||||
room::events it
|
||||
|
@ -53,8 +53,8 @@ const
|
|||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::events::missing::rfor_each(const pair<int64_t> &depth,
|
||||
const closure &closure)
|
||||
ircd::m::room::missing::rfor_each(const pair<int64_t> &depth,
|
||||
const closure &closure)
|
||||
const
|
||||
{
|
||||
room::events it
|
||||
|
@ -78,8 +78,8 @@ const
|
|||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::events::missing::_each(m::room::events &it,
|
||||
const closure &closure)
|
||||
ircd::m::room::missing::_each(m::room::events &it,
|
||||
const closure &closure)
|
||||
const
|
||||
{
|
||||
const m::event event
|
|
@ -43,7 +43,7 @@ ircd::m::twain(const room &room)
|
|||
-1, 0
|
||||
};
|
||||
|
||||
const room::events::sounding s
|
||||
const room::sounding s
|
||||
{
|
||||
room
|
||||
};
|
||||
|
@ -66,7 +66,7 @@ ircd::m::sounding(const room &room)
|
|||
-1, 0
|
||||
};
|
||||
|
||||
const room::events::sounding s
|
||||
const room::sounding s
|
||||
{
|
||||
room
|
||||
};
|
||||
|
@ -90,7 +90,7 @@ ircd::m::hazard(const room &room)
|
|||
0, 0
|
||||
};
|
||||
|
||||
const room::events::sounding s
|
||||
const room::sounding s
|
||||
{
|
||||
room
|
||||
};
|
||||
|
@ -106,11 +106,11 @@ ircd::m::hazard(const room &room)
|
|||
}
|
||||
|
||||
//
|
||||
// room::events::sounding
|
||||
// room::sounding
|
||||
//
|
||||
|
||||
bool
|
||||
ircd::m::room::events::sounding::rfor_each(const closure &closure)
|
||||
ircd::m::room::sounding::rfor_each(const closure &closure)
|
||||
const
|
||||
{
|
||||
const int64_t depth
|
||||
|
@ -155,7 +155,7 @@ const
|
|||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::events::sounding::for_each(const closure &closure)
|
||||
ircd::m::room::sounding::for_each(const closure &closure)
|
||||
const
|
||||
{
|
||||
const int64_t depth
|
|
@ -9415,7 +9415,7 @@ console_cmd__room(opt &out, const string_view &line)
|
|||
out << std::endl;
|
||||
out << "recent missing: " << std::endl;
|
||||
|
||||
const m::room::events::missing missing
|
||||
const m::room::missing missing
|
||||
{
|
||||
room
|
||||
};
|
||||
|
@ -9463,7 +9463,7 @@ console_cmd__room(opt &out, const string_view &line)
|
|||
out << "recent gaps: " << std::endl;
|
||||
|
||||
size_t gap_count(4);
|
||||
const m::room::events::sounding gaps
|
||||
const m::room::sounding gaps
|
||||
{
|
||||
room
|
||||
};
|
||||
|
@ -9832,7 +9832,7 @@ console_cmd__room__depth__gaps(opt &out, const string_view &line)
|
|||
return true;
|
||||
}};
|
||||
|
||||
const m::room::events::sounding gaps
|
||||
const m::room::sounding gaps
|
||||
{
|
||||
room
|
||||
};
|
||||
|
@ -11310,7 +11310,7 @@ console_cmd__room__events__missing(opt &out, const string_view &line)
|
|||
m::top(room)
|
||||
};
|
||||
|
||||
const m::room::events::missing missing
|
||||
const m::room::missing missing
|
||||
{
|
||||
room
|
||||
};
|
||||
|
@ -11386,7 +11386,7 @@ console_cmd__room__events__missing__count(opt &out, const string_view &line)
|
|||
room_id, event_id
|
||||
};
|
||||
|
||||
const m::room::events::missing missing
|
||||
const m::room::missing missing
|
||||
{
|
||||
room
|
||||
};
|
||||
|
@ -11418,7 +11418,7 @@ console_cmd__room__events__horizon(opt &out, const string_view &line)
|
|||
room_id
|
||||
};
|
||||
|
||||
const m::room::events::horizon horizon
|
||||
const m::room::horizon horizon
|
||||
{
|
||||
room
|
||||
};
|
||||
|
@ -11462,7 +11462,7 @@ console_cmd__room__events__horizon__count(opt &out, const string_view &line)
|
|||
room_id, event_id
|
||||
};
|
||||
|
||||
const m::room::events::horizon horizon
|
||||
const m::room::horizon horizon
|
||||
{
|
||||
room
|
||||
};
|
||||
|
@ -11489,7 +11489,7 @@ console_cmd__room__events__horizon__rebuild(opt &out, const string_view &line)
|
|||
room_id
|
||||
};
|
||||
|
||||
m::room::events::horizon horizon
|
||||
m::room::horizon horizon
|
||||
{
|
||||
room
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue