class transparent_container_input_resource


template <
    typename Container
>
class transparent_container_input_resource
    : public virtual seekable_input_resource<std::int64_t>
    , public virtual impl::ctr_essence<Container>

Description

A transparent container input resource is an input resource that reads from a container that it does not own.

Public Aliases

using content_type = Container

The type of content referenced by this transparent container input resource.

using element_type = typename Container::value_type

The type of element of the content referenced by this transparent container input resource.

Public Member Functions

explicit
transparent_container_input_resource (
    const content_type& initial_content,
    std::size_t buffer_capacity = 0
)

Constructs a transparent container input resource with the given initial content and buffer capacity.

Parameters:
  • initial_content:

    The content that this transparent container input resource will reference.

  • buffer_capacity:

    The capacity of the I/O buffer. If this is zero, the transparent container input resource is completely unbuffered.

transparent_container_input_resource (
    const transparent_container_input_resource& other
)

Copy-constructs a transparent_container_input_resource from an existing one.

Parameters:
  • other:

    The transparent_container_input_resource to copy from.

transparent_container_input_resource&
operator = (
    const transparent_container_input_resource& other
)

Copy-assigns a transparent_container_input_resource into this one.

Parameters:
  • other:

    The transparent_container_input_resource to copy from.

transparent_container_input_resource (
    transparent_container_input_resource&& other
)
noexcept

Move-constructs a transparent_container_input_resource from an existing one.

Parameters:
  • other:

    The transparent_container_input_resource to move from.

transparent_container_input_resource&
operator = (
    transparent_container_input_resource&& other
)
noexcept

Move-assigns a transparent_container_input_resource into this one.

Parameters:
  • other:

    The transparent_container_input_resource to move from.

bool
is_at_end ()
const noexcept override

Returns true if this transparent container input resource is at the end of its referenced content. Otherwise, returns false.

std::int64_t
get_position ()
const noexcept override

Returns the position this transparent container input resource is at, that is, the position at which read operations will take place next.

const content_type&
grab_content ()
const noexcept

Returns a constant reference to the referenced content.

Protected Member Functions

void
set_position_raw (
    std::int64_t new_position,
    position_reference pr
)
noexcept override
std::size_t
read_raw (
    std::byte* data,
    std::size_t byte_count,
    read_request rr
)
override

Reads byte_count bytes from this transparent container input resource and places them in the provided data array.

Parameters:
  • data:

    The array into which the read bytes will be placed.

  • byte_count:

    The number of bytes to read from this input resource.

  • rr:

    The kind of read request that is being issued to this input resource.



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.