class seekable_transfer_resource


template <
    typename Position
>
class seekable_transfer_resource
    : public virtual transfer_resource

Description

A seekable transfer resource is a transfer resource that can seek, that is, change where read or write operations will take place next.

Public Aliases

using position_type = Position

The type of this resource's position.

Public Member Functions

explicit
seekable_transfer_resource (
    std::size_t buffer_capacity = io_buffer::default_buffer_capacity
)

Constructs a seekable transfer resource with the given buffer capacity.

Parameters:
  • buffer_capacity:

    The capacity of the I/O buffer. If this is zero, the seekable transfer resource is completely unbuffered.

seekable_transfer_resource (
    const seekable_transfer_resource& other
)

Copy-constructs a seekable_transfer_resource from an existing one.

Parameters:
  • other:

    The seekable_transfer_resource to copy from.

seekable_transfer_resource&
operator = (
    const seekable_transfer_resource& other
)

Copy-assigns a seekable_transfer_resource into this one.

Parameters:
  • other:

    The seekable_transfer_resource to copy from.

seekable_transfer_resource (
    seekable_transfer_resource&& other
)
noexcept

Move-constructs a seekable_transfer_resource from an existing one.

Parameters:
  • other:

    The seekable_transfer_resource to move from.

seekable_transfer_resource&
operator = (
    seekable_transfer_resource&& other
)
noexcept

Move-assigns a seekable_transfer_resource into this one.

Parameters:
  • other:

    The seekable_transfer_resource to move from.

virtual
position_type
get_position ()
const noexcept = 0

This function must be overridden, and it is supposed to return the position that this seekable transfer resource is at.

virtual
void
set_position (
    position_type new_position,
    position_reference pr
)
noexcept = 0

This function is overridden in seekable_input_resource and seekable_output_resource, it sets the position of this seekable transfer resource to new_position, relative to pr.

Parameters:
  • new_position:

    The new position of this seekable transfer resource.

  • pr:

    The reference that the new position is relative to.

void
go_back (
    position_type count
)
noexcept

Sets the position of this seekable transfer resource to be -count, relative to the seekable transfer resource's current position.

Parameters:
  • count:

    The amount by which to go back in the seekable transfer resource.

void
go_forward (
    position_type count
)
noexcept

Sets the position of this seekable transfer resource to be count, relative to the seekable transfer resource's current position.

Parameters:
  • count:

    The amount by which to go forward in the seekable transfer resource.

Protected Member Functions

virtual
void
set_position_raw (
    position_type new_position,
    position_reference pr
)
noexcept = 0

This function must be overridden, and it is supposed to set the position of this seekable transfer resource to new_position, relative to pr.

Parameters:
  • new_position:

    The new position of this seekable transfer resource.

  • pr:

    The reference that the new position is relative to.



Copyright © 2022-2025 Daniel T. McGinnis

CCL was first published in 2022, and is still actively maintained.

This website was first published in 2022, and is still actively maintained.

This specific web page was first published in 2023.