# sxyzccr/ccr-plus architecture

> Architecture diagram of the GitHub repository sxyzccr/ccr-plus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sxyzccr/ccr-plus
- Repository: https://github.com/sxyzccr/ccr-plus

## Overview

CCR Plus is a Qt-based contest judging environment for traditional and answer-only problems. The main workflow is to open a contest, configure problems and test cases, select submissions for judging, and view per-problem and aggregate results. The graph separates contest data, configuration, judging, and the UI. Source excerpts show the judge-thread dispatch and result updates; README statements support the documented configuration capabilities. Some configuration internals and persistence links are not shown, so those relationships are omitted.

Main entry points: [`src/mainwindow/mainwindow.cpp`](https://github.com/sxyzccr/ccr-plus/blob/master/src/mainwindow/mainwindow.cpp) (Main window), [`src/judge/judgethread.cpp`](https://github.com/sxyzccr/ccr-plus/blob/master/src/judge/judgethread.cpp) (Judge coordinator), [`src/configure/advancedconfiguredialog.cpp`](https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/advancedconfiguredialog.cpp) (Advanced settings), [`src/common/contest.cpp`](https://github.com/sxyzccr/ccr-plus/blob/master/src/common/contest.cpp) (Contest model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Contest interface"]
  node_main["Main window<br/>[mainwindow.cpp]"]
  node_board["Scoreboard<br/>[boardtable.cpp]"]
  node_details["Judge details<br/>[detailtable.cpp]"]
end

subgraph group_config["Problem configuration"]
  node_configure["Problem settings<br/>[configuretable.cpp]"]
  node_configdialog["Configuration dialog"]
  node_advanced["Advanced settings"]
  node_compiler["Compiler settings"]
  node_testcases["Test-case settings<br/>[testcasetable.cpp]"]
end

subgraph group_domain["Contest data"]
  node_contest["Contest model<br/>[contest.cpp]"]
  node_players["Players and results<br/>[player.cpp]"]
  node_problems["Problem definitions<br/>[problem.cpp]"]
end

subgraph group_judge["Judging runtime"]
  node_thread["Judge coordinator<br/>[judgethread.cpp]"]
  node_judgers["Problem-type judgers"]
  node_execution["Compile and execute<br/>[basejudger.cpp]"]
  node_checker["Output checker<br/>[basejudger.cpp]"]
  node_monitor["Process monitor<br/>[monitor.c]"]
end

node_operator(("Contest operator"))

node_operator -->|"uses"| node_main
node_main -->|"displays"| node_board
node_main -->|"displays"| node_details
node_main -->|"starts"| node_thread
node_main -->|"opens"| node_configdialog
node_main -->|"opens"| node_advanced
node_main -.->|"loads"| node_contest
node_contest -.->|"contains"| node_players
node_contest -.->|"contains"| node_problems
node_configdialog -.->|"edits"| node_configure
node_advanced -.->|"configures"| node_compiler
node_advanced -.->|"configures"| node_testcases
node_thread -->|"dispatches"| node_judgers
node_thread -->|"updates"| node_players
node_thread -->|"saves HTML"| node_players
node_thread -->|"forwards details"| node_details
node_judgers -->|"inherits"| node_execution
node_execution -->|"checks output"| node_checker
node_execution -->|"launches"| node_monitor

click node_main "https://github.com/sxyzccr/ccr-plus/blob/master/src/mainwindow/mainwindow.cpp"
click node_board "https://github.com/sxyzccr/ccr-plus/blob/master/src/mainwindow/boardtable.cpp"
click node_details "https://github.com/sxyzccr/ccr-plus/blob/master/src/mainwindow/detailtable.cpp"
click node_contest "https://github.com/sxyzccr/ccr-plus/blob/master/src/common/contest.cpp"
click node_players "https://github.com/sxyzccr/ccr-plus/blob/master/src/common/player.cpp"
click node_problems "https://github.com/sxyzccr/ccr-plus/blob/master/src/common/problem.cpp"
click node_configure "https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/configuretable.cpp"
click node_configdialog "https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/configuredialog.cpp"
click node_advanced "https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/advancedconfiguredialog.cpp"
click node_compiler "https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/compiler/compilertabwidget.cpp"
click node_testcases "https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/testcase/testcasetable.cpp"
click node_thread "https://github.com/sxyzccr/ccr-plus/blob/master/src/judge/judgethread.cpp"
click node_judgers "https://github.com/sxyzccr/ccr-plus/blob/master/src/judge/judger/traditionaljudger.cpp"
click node_execution "https://github.com/sxyzccr/ccr-plus/blob/master/src/judge/judger/basejudger.cpp"
click node_checker "https://github.com/sxyzccr/ccr-plus/blob/master/src/judge/judger/basejudger.cpp"
click node_monitor "https://github.com/sxyzccr/ccr-plus/blob/master/src/tools/monitor/monitor.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_board,node_details toneBlue
class node_configure,node_configdialog,node_advanced,node_compiler,node_testcases toneAmber
class node_contest,node_players,node_problems toneMint
class node_thread,node_judgers,node_execution,node_checker,node_monitor toneRose
class node_operator toneIndigo
```

## Components

### Contest interface

- [Main window](https://github.com/sxyzccr/ccr-plus/blob/master/src/mainwindow/mainwindow.cpp): `src/mainwindow/mainwindow.cpp`
- [Scoreboard](https://github.com/sxyzccr/ccr-plus/blob/master/src/mainwindow/boardtable.cpp): `src/mainwindow/boardtable.cpp`
- [Judge details](https://github.com/sxyzccr/ccr-plus/blob/master/src/mainwindow/detailtable.cpp): `src/mainwindow/detailtable.cpp`

### Problem configuration

- [Problem settings](https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/configuretable.cpp): `src/configure/configuretable.cpp`
- [Configuration dialog](https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/configuredialog.cpp): `src/configure/configuredialog.cpp`
- [Advanced settings](https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/advancedconfiguredialog.cpp): `src/configure/advancedconfiguredialog.cpp`
- [Compiler settings](https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/compiler/compilertabwidget.cpp): `src/configure/compiler/compilertabwidget.cpp`
- [Test-case settings](https://github.com/sxyzccr/ccr-plus/blob/master/src/configure/testcase/testcasetable.cpp): `src/configure/testcase/testcasetable.cpp`

### Contest data

- [Contest model](https://github.com/sxyzccr/ccr-plus/blob/master/src/common/contest.cpp): `src/common/contest.cpp`
- [Players and results](https://github.com/sxyzccr/ccr-plus/blob/master/src/common/player.cpp): `src/common/player.cpp`
- [Problem definitions](https://github.com/sxyzccr/ccr-plus/blob/master/src/common/problem.cpp): `src/common/problem.cpp`

### Judging runtime

- [Judge coordinator](https://github.com/sxyzccr/ccr-plus/blob/master/src/judge/judgethread.cpp): `src/judge/judgethread.cpp`
- [Problem-type judgers](https://github.com/sxyzccr/ccr-plus/blob/master/src/judge/judger/traditionaljudger.cpp): `src/judge/judger/traditionaljudger.cpp`
- [Compile and execute](https://github.com/sxyzccr/ccr-plus/blob/master/src/judge/judger/basejudger.cpp): `src/judge/judger/basejudger.cpp`
- [Output checker](https://github.com/sxyzccr/ccr-plus/blob/master/src/judge/judger/basejudger.cpp): `src/judge/judger/basejudger.cpp`
- [Process monitor](https://github.com/sxyzccr/ccr-plus/blob/master/src/tools/monitor/monitor.c): `src/tools/monitor/monitor.c`

### Other components

- **Contest operator**

## Connections

- Contest operator → Main window: uses
- Main window → Scoreboard: displays (evidence: `src/mainwindow/mainwindow.cpp`)
- Main window → Judge details: displays (evidence: `src/mainwindow/mainwindow.cpp`)
- Main window → Judge coordinator: starts (evidence: `src/mainwindow/mainwindow.cpp`)
- Main window → Configuration dialog: opens (evidence: `src/mainwindow/mainwindow.cpp`)
- Main window → Advanced settings: opens (evidence: `src/mainwindow/mainwindow.cpp`)
- Main window → Contest model: loads
- Contest model → Players and results: contains
- Contest model → Problem definitions: contains
- Configuration dialog → Problem settings: edits
- Advanced settings → Compiler settings: configures
- Advanced settings → Test-case settings: configures
- Judge coordinator → Problem-type judgers: dispatches (evidence: `src/judge/judgethread.cpp`)
- Judge coordinator → Players and results: updates (evidence: `src/judge/judgethread.cpp`)
- Judge coordinator → Players and results: saves HTML (evidence: `src/judge/judgethread.cpp`)
- Judge coordinator → Judge details: forwards details
- Problem-type judgers → Compile and execute: inherits (evidence: `src/judge/judger/traditionaljudger.cpp`)
- Compile and execute → Output checker: checks output (evidence: `src/judge/judger/basejudger.cpp`)
- Compile and execute → Process monitor: launches (evidence: `src/judge/judger/basejudger.cpp`)
