Go to the documentation of this file.
20 #include <aws/common/common.h>
21 #include <aws/io/socket.h>
22 #include <aws/mqtt/mqtt.h>
29 #include <unordered_map>
35 struct aws_byte_cursor;
36 struct aws_socket_options;
48 using IStream = std::basic_istream<char, std::char_traits<char>>;
53 using QOS = aws_mqtt_qos;
61 template <
typename K,
typename V>
64 template <
typename K,
typename V>
66 template <
typename T>
using Vector = std::vector<T, StlAllocator<T>>;
67 template <
typename T>
using List = std::list<T, StlAllocator<T>>;
86 aws_mem_release(allocator, t);
89 template <
typename T,
typename... Args> T *
New(
Allocator *allocator, Args &&... args)
91 T *t =
reinterpret_cast<T *
>(aws_mem_acquire(allocator,
sizeof(T)));
94 return new (t) T(std::forward<Args>(args)...);
97 template <
typename T,
typename... Args> std::shared_ptr<T>
MakeShared(
Allocator *allocator, Args &&... args)
99 T *t =
reinterpret_cast<T *
>(aws_mem_acquire(allocator,
sizeof(T)));
102 new (t) T(std::forward<Args>(args)...);
104 return std::shared_ptr<T>(t, [allocator](T *obj) {
Delete(obj, allocator); });
107 template <
typename T>
using ScopedResource = std::unique_ptr<T, std::function<void(T *)>>;
aws_allocator Allocator
Definition: StlAllocator.h:25
std::shared_ptr< T > MakeShared(Allocator *allocator, Args &&... args)
Definition: Types.h:97
std::vector< T, StlAllocator< T > > Vector
Definition: Types.h:66
AWS_CRT_CPP_API Vector< uint8_t > Base64Decode(const String &decode)
Definition: Types.cpp:56
#define AWS_CRT_CPP_API
Definition: Exports.h:34
std::unordered_map< K, V, std::hash< K >, std::equal_to< K >, StlAllocator< std::pair< const K, V > >> UnorderedMap
Definition: Types.h:63
AWS_CRT_CPP_API ByteCursor ByteCursorFromArray(const uint8_t *array, size_t len) noexcept
Definition: Types.cpp:51
AWS_CRT_CPP_API ByteBuf ByteBufNewCopy(Allocator *alloc, const uint8_t *array, size_t len)
Definition: Types.cpp:37
AWS_CRT_CPP_API ByteCursor ByteCursorFromByteBuf(const ByteBuf &) noexcept
Definition: Types.cpp:49
std::basic_istream< char, std::char_traits< char > > IStream
Definition: Types.h:48
aws_byte_cursor ByteCursor
Definition: Types.h:44
AWS_CRT_CPP_API ByteBuf ByteBufFromCString(const char *str) noexcept
Definition: Types.cpp:25
std::basic_stringstream< char, std::char_traits< char >, StlAllocator< char > > StringStream
Definition: Types.h:59
std::unique_ptr< T, std::function< void(T *)> > ScopedResource
Definition: Types.h:107
aws_byte_buf ByteBuf
Definition: Types.h:43
AWS_CRT_CPP_API ByteBuf ByteBufFromArray(const uint8_t *array, size_t capacity) noexcept
Definition: Types.cpp:32
aws_mqtt_connect_return_code ReturnCode
Definition: Types.h:54
std::list< T, StlAllocator< T > > List
Definition: Types.h:67
T * New(Allocator *allocator, Args &&... args)
Definition: Types.h:89
AWS_CRT_CPP_API Allocator * DefaultAllocator() noexcept
Definition: Types.cpp:23
char const int len
Definition: cJSON.cpp:1052
AWS_CRT_CPP_API ByteCursor ByteCursorFromCString(const char *str) noexcept
Definition: Types.cpp:47
std::multimap< K, V, std::less< K >, StlAllocator< std::pair< const K, V > >> MultiMap
Definition: Types.h:65
AWS_CRT_CPP_API void ByteBufDelete(ByteBuf &)
Definition: Types.cpp:45
Definition: StlAllocator.h:29
AWS_CRT_CPP_API String Base64Encode(const Vector< uint8_t > &encode)
Definition: Types.cpp:77
std::basic_string< char, std::char_traits< char >, StlAllocator< char > > String
Definition: Types.h:58
AWS_CRT_CPP_API ByteBuf ByteBufFromEmptyArray(const uint8_t *array, size_t len) noexcept
Definition: Types.cpp:27
aws_mqtt_qos QOS
Definition: Types.h:53
std::map< K, V, std::less< K >, StlAllocator< std::pair< const K, V > >> Map
Definition: Types.h:60
void Delete(T *t, Allocator *allocator)
Definition: Types.h:83