aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Aws::Crt::S3::S3BufferTicket Class Referencefinal

#include <S3BufferTicket.h>

Public Member Functions

 S3BufferTicket (const S3BufferTicket &)=delete
 
 S3BufferTicket (S3BufferTicket &&)=delete
 
S3BufferTicketoperator= (const S3BufferTicket &)=delete
 
S3BufferTicketoperator= (S3BufferTicket &&)=delete
 
 ~S3BufferTicket () noexcept=default
 
std::shared_ptr< S3BufferTicketAcquire () noexcept
 
ByteCursor Claim () noexcept
 

Detailed Description

Owning handle to a buffer that the CRT has loaned out as part of a stream download. The CRT delivers each received part by invoking the BodyCallbackEx with a borrowed ticket pointing at memory in the CRT's pool. The ticket is alive only for the duration of that callback; call Acquire() inside the callback to obtain a shared_ptr that keeps the buffer valid until the last copy of it is destroyed.

Constructor & Destructor Documentation

◆ S3BufferTicket() [1/2]

Aws::Crt::S3::S3BufferTicket::S3BufferTicket ( const S3BufferTicket )
delete

◆ S3BufferTicket() [2/2]

Aws::Crt::S3::S3BufferTicket::S3BufferTicket ( S3BufferTicket &&  )
delete

◆ ~S3BufferTicket()

Aws::Crt::S3::S3BufferTicket::~S3BufferTicket ( )
defaultnoexcept

Member Function Documentation

◆ Acquire()

std::shared_ptr< S3BufferTicket > Aws::Crt::S3::S3BufferTicket::Acquire ( )
noexcept

Take a new reference to the underlying buffer and hand it back as a shared_ptr. Copy the returned shared_ptr freely to share the buffer across owners; the CRT reference is released once when the last copy is destroyed, so acquire/release stays hidden behind the shared_ptr interface.

Returns
a shared handle keeping the buffer valid until the last copy is destroyed.

◆ Claim()

ByteCursor Aws::Crt::S3::S3BufferTicket::Claim ( )
noexcept

Return a cursor over the object bytes this ticket references. The cursor points directly into the CRT-owned buffer - reading from it copies nothing. It stays valid as long as this ticket (or a shared_ptr obtained from Acquire()) is alive. Returns an empty cursor if the ticket holds no buffer.

Returns
a cursor into the buffer; empty if there is none.

◆ operator=() [1/2]

S3BufferTicket & Aws::Crt::S3::S3BufferTicket::operator= ( const S3BufferTicket )
delete

◆ operator=() [2/2]

S3BufferTicket & Aws::Crt::S3::S3BufferTicket::operator= ( S3BufferTicket &&  )
delete

The documentation for this class was generated from the following files: