{ "format": 1, "id": "saw-ring_buffer", "kind": "class", "name": "ring_buffer", "namespace": "saw", "module": "core", "header": "modules/core/c++/buffer.hpp", "brief_description": "Buffer wrapping around if the read cursor caught up.", "detailed_description": [ [ "Fixed capacity, reused in place. Suited to a stream where bytes are produced and consumed continuously, since nothing is allocated after construction." ], [ "The capacity does not grow, so a write beyond what the reader has freed fails with", {"name": "buffer_exhausted", "id": "saw-err-buffer_exhausted"}, "rather than resizing." ] ], "bases": [ [{"name": "buffer", "id": "saw-buffer"}] ], "attributes": { "saw-ring_buffer-write_reached_read_": { "id": "saw-ring_buffer-write_reached_read_", "name": "write_reached_read_", "type": ["bool"], "visibility": "private", "brief_description": "Distinguishes a full buffer from an empty one, since both have equal cursors." } }, "functions": { "saw-ring_buffer-ctor-1": { "id": "saw-ring_buffer-ctor-1", "name": "ring_buffer", "type": [], "brief_description": "With the default capacity of RING_BUFFER_MAX_SIZE bytes." }, "saw-ring_buffer-ctor-2": { "id": "saw-ring_buffer-ctor-2", "name": "ring_buffer", "type": [], "parameters": [ {"name": "size", "type": ["size_t"]} ] }, "saw-ring_buffer-size": { "id": "saw-ring_buffer-size", "name": "size", "type": ["size_t"], "const": true, "brief_description": "Total capacity, not the amount currently held." } } }