// Matrix Construct // // Copyright (C) Matrix Construct Developers, Authors & Contributors // Copyright (C) 2016-2018 Jason Volk // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. #pragma once #define HAVE_IRCD_M_EVENT_PREV_H namespace ircd::m { bool for_each(const event::prev &, const event::id::closure_bool &); void for_each(const event::prev &, const event::id::closure &); size_t degree(const event::prev &); size_t count(const event::prev &); std::ostream &pretty(std::ostream &, const event::prev &); std::string pretty(const event::prev &); std::ostream &pretty_oneline(std::ostream &, const event::prev &); std::string pretty_oneline(const event::prev &); } struct ircd::m::event::prev :json::tuple < json::property, json::property, json::property > { enum cond :int; std::tuple auth_events(const uint &idx) const; std::tuple prev_states(const uint &idx) const; std::tuple prev_events(const uint &idx) const; event::id auth_event(const uint &idx) const; event::id prev_state(const uint &idx) const; event::id prev_event(const uint &idx) const; size_t auth_events_count() const; size_t prev_states_count() const; size_t prev_events_count() const; bool auth_events_has(const event::id &) const; bool prev_states_has(const event::id &) const; bool prev_events_has(const event::id &) const; using super_type::tuple; using super_type::operator=; };