app/broadcast.h¶
choosing what to mirror (broadcast-docs/PLAN.md §4, B3).
Two selection steps sit in front of BroadcastSession, and both are pure:
WHICH TOURNAMENT. /api/broadcast/top lists what is live now, each entry carrying a tournament and its most relevant round. The round’s 8-character id is what the stream endpoint takes.
WHICH BOARD. A round’s PGN carries every game in the tournament — often a hundred boards. The stream re-sends a whole game whenever that game changes, so a round is not a list you fetch once; it is a set of boards accumulated and upserted as snapshots arrive. BroadcastRound is that state.
The upsert must key on game identity, never on arrival order or position in the file: the API explicitly adds games to a round mid-stream, so an index would silently re-point a running mirror at a different board.
Real rounds contain boards that cannot be mirrored — ones with no moves yet (normal: a round is published before play starts), ones with no pairing set, and non-standard variants. playable() is the picker’s filter; nothing here treats any of them as an error.
-
namespace kirin
-
struct BroadcastGame¶
- #include <broadcast.h>
-
class BroadcastRound¶
- #include <broadcast.h>
Public Functions
-
int applyPgn(const std::string &pgnText)¶
-
inline const std::vector<BroadcastGame> &games() const¶
-
const BroadcastGame *find(const std::string &key) const¶
-
std::vector<BroadcastGame> playable() const¶
-
inline size_t size() const¶
-
inline void clear()¶
Private Members
-
std::vector<BroadcastGame> games_¶
-
int applyPgn(const std::string &pgnText)¶
-
struct BroadcastRoundRef¶
- #include <broadcast.h>
-
struct BroadcastGame¶