diff --git a/README.md b/README.md index c70096ea..10e775be 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ constant-time insertion and removal at either end, and it works with the standard algorithms. Once its capacity is set, it doesn't allocate memory until you change the capacity yourself. -![circular_buffer](doc/images/circular_buffer.png) +![A circular buffer: items stored clockwise from begin() to end(), with free space beyond](doc/images/circular_buffer.svg) ```cpp #include diff --git a/doc/circular_buffer.qbk b/doc/circular_buffer.qbk index 37f0c9fc..65f0561a 100644 --- a/doc/circular_buffer.qbk +++ b/doc/circular_buffer.qbk @@ -50,11 +50,11 @@ The __cb only allocates memory when created, when the capacity is adjusted explicitly, or as necessary to accommodate resizing or assign operations. -[$../../libs/circular_buffer/doc/images/circular_buffer.png] +[$../../libs/circular_buffer/doc/images/circular_buffer.svg] There is also a __cbso version available. -[$../../libs/circular_buffer/doc/images/space_optimized.png] +[$../../libs/circular_buffer/doc/images/space_optimized.svg] __cbso is an adaptation of the __cb which [*does not allocate memory all at once when created], diff --git a/doc/images/circular_buffer.png b/doc/images/circular_buffer.png deleted file mode 100644 index 1370a4b5..00000000 Binary files a/doc/images/circular_buffer.png and /dev/null differ diff --git a/doc/images/circular_buffer.svg b/doc/images/circular_buffer.svg new file mode 100644 index 00000000..bb47ece6 --- /dev/null +++ b/doc/images/circular_buffer.svg @@ -0,0 +1,54 @@ + + circular_buffer + A ring of storage: items 1 to n are stored from begin() clockwise up to end(); the remaining free space is filled as the buffer grows. + + + + + + + + + + + + item 1 + + item 2 + + … + + item n + + + + begin() + + end() + + growth + free space + diff --git a/doc/images/space_optimized.png b/doc/images/space_optimized.png deleted file mode 100644 index 4f29f8c2..00000000 Binary files a/doc/images/space_optimized.png and /dev/null differ diff --git a/doc/images/space_optimized.svg b/doc/images/space_optimized.svg new file mode 100644 index 00000000..c5a18bd5 --- /dev/null +++ b/doc/images/space_optimized.svg @@ -0,0 +1,72 @@ + + circular_buffer_space_optimized + A space-optimized buffer starts with min_capacity() allocated, allocates more memory as items are added up to the full capacity, and frees it again as items are removed. + + + + + + + + + + + + 1 + + 2 + + + + + min_capacity() + + + 1 + + 2 + + … + + n + + + + + + 1 + + 2 + + … + + n + + + more items in the buffer + + fewer items in the buffer + diff --git a/doc/jamfile.v2 b/doc/jamfile.v2 index 31ef5b19..b4dc2798 100644 --- a/doc/jamfile.v2 +++ b/doc/jamfile.v2 @@ -72,7 +72,7 @@ doxygen autodoc # BOOST_DEDUCED_TYPENAME will be replaced by "typename", # BOOST_CONSTEXPR will be replaced by "constexpr". EXCLUDE_SYMBOLS=*_throws - # IMAGE_PATH="../images" # for circular_buffer.png + # IMAGE_PATH="../images" # for circular_buffer.svg # See autodoxywarnings.log to check this is correct. # The syntax hoops to jump through are 'interesting' for more than one PREDEFINED,