A general state machine for foreground and background buffer swapping.
More...
#include <swapping_buffer.hpp>
|
|
| swapping_buffer () noexcept |
| | Creates an instance.
|
| |
| | swapping_buffer (std::span< T > swapped_out, std::span< T > unswapped_out) noexcept |
| | Creates an instance.
|
| |
|
void | reset (std::span< const T > input) noexcept |
| |
| void | set_out (std::span< T > swapped_out, std::span< T > unswapped_out, std::span< const T > input={}) noexcept |
| | Sets the outputs.
|
| |
| auto | set_temporary_out (std::span< T > swapped_out, std::span< T > unswapped_out, std::span< const T > input={}) noexcept |
| | Set temporary outputs which is scoped in the current context. The output buffers will be restored when the return RAII token is out of scope.
|
| |
|
void | swap () noexcept |
| | Swaps the buffers.
|
| |
| std::span< const T > | in () const noexcept |
| | Gets the current input buffer.
|
| |
| std::span< T > & | out () noexcept |
| | Gets the lvalue reference to the current output buffer, which is replaceable with a subspan.
|
| |
| std::span< T > | original_out () const noexcept |
| | Gets the original output buffer.
|
| |
template<typename T>
class essence::memory::swapping_buffer< T >
A general state machine for foreground and background buffer swapping.
- Template Parameters
-
| T | The type of element of the buffer. |
◆ swapping_buffer()
Creates an instance.
- Parameters
-
| swapped_out | The output buffer when the state is swapped. |
| unswapped_out | The output buffer when the state is unswapped. |
◆ in()
Gets the current input buffer.
- Returns
- The input buffer.
◆ original_out()
Gets the original output buffer.
- Returns
- The output buffer.
◆ out()
Gets the lvalue reference to the current output buffer, which is replaceable with a subspan.
- Returns
- The lvalue reference to the output buffer.
◆ set_out()
Sets the outputs.
- Parameters
-
| swapped_out | The output buffer when the state is swapped. |
| unswapped_out | The output buffer when the state is unswapped. |
| input | The input buffer. |
◆ set_temporary_out()
Set temporary outputs which is scoped in the current context. The output buffers will be restored when the return RAII token is out of scope.
- Parameters
-
| swapped_out | The output buffer when the state is swapped. |
| unswapped_out | The output buffer when the state is unswapped. |
| input | The input buffer. |
- Returns
- The RAII token. RAII Token。
The documentation for this class was generated from the following file: