Read-only view over the set of buffers the chrome should list. IpcBufferModel is backed by live IPC state; MockBufferModel below is the deterministic stand-in consumed by UiState and StageManager.
| 60 | // IpcBufferModel is backed by live IPC state; MockBufferModel below is the |
| 61 | // deterministic stand-in consumed by UiState and StageManager. |
| 62 | class BufferModel { |
| 63 | public: |
| 64 | virtual ~BufferModel() = default; |
| 65 | |
| 66 | virtual std::size_t size() const = 0; |
| 67 | virtual const BufferRecord& at(std::size_t i) const = 0; |
| 68 | |
| 69 | // Stable key identifying the buffer at slot `i` (its variable_name), |
| 70 | // used by StageManager to re-key Stages by identity rather than |
| 71 | // by index, since a dynamic model (IpcBufferModel) may insert/remove |
| 72 | // slots at runtime. |
| 73 | virtual const std::string& variable_name_of(std::size_t i) const = 0; |
| 74 | |
| 75 | // Monotonic per-slot revision, bumped whenever the BufferRecord at slot |
| 76 | // `i` is replaced (e.g. a re-plot). StageManager compares this against |
| 77 | // the revision it last observed to decide whether to rebuild the |
| 78 | // Stage's GL buffer via Stage::buffer_update() rather than reuse it. |
| 79 | virtual std::uint64_t revision_of(std::size_t i) const = 0; |
| 80 | }; |
| 81 | |
| 82 | // Deterministic, IPC-free BufferModel: holds a fixed vector<BufferRecord> |
| 83 | // supplied at construction (typically via make_default_mock_model()), so |
nothing calls this directly
no outgoing calls
no test coverage detected