aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
S3BufferTicket.h
Go to the documentation of this file.
1 #pragma once
2 
7 #include <aws/crt/Exports.h>
8 #include <aws/crt/Types.h>
9 
10 #include <memory>
11 
12 struct aws_s3_buffer_ticket;
13 
14 namespace Aws
15 {
16  namespace Crt
17  {
18  namespace S3
19  {
29  {
30  public:
31  S3BufferTicket(const S3BufferTicket &) = delete;
32  S3BufferTicket(S3BufferTicket &&) = delete;
33  S3BufferTicket &operator=(const S3BufferTicket &) = delete;
34  S3BufferTicket &operator=(S3BufferTicket &&) = delete;
35 
36  ~S3BufferTicket() noexcept = default;
37 
48  std::shared_ptr<S3BufferTicket> Acquire() noexcept;
49 
59  ByteCursor Claim() noexcept;
60 
65  explicit S3BufferTicket(struct aws_s3_buffer_ticket *ticket) noexcept;
66 
67  private:
68  // Borrowed, non-owning: the reference is owned by the CRT (for the
69  // stack ticket in the callback) or by an Acquire() shared_ptr's
70  // deleter - never released by this raw handle directly.
71  struct aws_s3_buffer_ticket *m_ticket;
72  };
73 
74  } // namespace S3
75  } // namespace Crt
76 } // namespace Aws
#define AWS_CRT_CPP_API
Definition: Exports.h:36
Definition: S3BufferTicket.h:28
aws_byte_cursor ByteCursor
Definition: Types.h:31
Definition: Allocator.h:10