59 Array(
const T* arrayToCopy,
size_t arraySize) :
63 if (arrayToCopy !=
nullptr &&
m_size > 0)
65 m_data.reset(Aws::NewArray<T>(
m_size, ARRAY_ALLOCATION_TAG));
68 std::copy(arrayToCopy, arrayToCopy + arraySize, stdext::checked_array_iterator< T * >(
m_data.get(),
m_size));
70 std::copy(arrayToCopy, arrayToCopy + arraySize,
m_data.get());
81 for(
auto& array : toMerge)
83 totalSize += array->m_size;
87 m_data.reset(Aws::NewArray<T>(
m_size, ARRAY_ALLOCATION_TAG));
90 for(
auto& arr : toMerge)
92 if(arr->m_size > 0 && arr->m_data)
94 size_t arraySize = arr->m_size;
96 std::copy(arr->m_data.get(), arr->m_data.get() + arraySize, stdext::checked_array_iterator< T * >(
m_data.get() + location,
m_size));
98 std::copy(arr->m_data.get(), arr->m_data.get() + arraySize,
m_data.get() + location);
100 location += arraySize;
112 m_data.reset(Aws::NewArray<T>(
m_size, ARRAY_ALLOCATION_TAG));
128 other.m_data =
nullptr;
131 virtual ~Array() =
default;
145 m_data.reset(Aws::NewArray<T>(
m_size, ARRAY_ALLOCATION_TAG));
160 m_data = std::move(other.m_data);
177 for (
unsigned i = 0; i <
m_size; ++i)
191 return !(*
this == other);
197 return m_data.get()[index];
203 return m_data.get()[index];
242 CryptoBuffer(
const unsigned char* arrayToCopy,
size_t arraySize) : ByteBuffer(arrayToCopy, arraySize) {}
Array(const T *arrayToCopy, size_t arraySize)
T const & operator[](size_t index) const
T * GetUnderlyingData() const
CryptoBuffer(CryptoBuffer &&other)
UniqueArrayPtr< T > MakeUniqueArray(std::size_t amount, const char *allocationTag, ArgTypes &&...args)
std::vector< T, Aws::Allocator< T > > Vector
bool operator!=(const CryptoBuffer &other) const
bool operator!=(const Array &other) const
static const char * ARRAY_ALLOCATION_TAG
Array(size_t arraySize=0)
CryptoBuffer(Aws::Vector< ByteBuffer * > &&toMerge)
T & GetItem(size_t index)
Array< unsigned char > ByteBuffer
CryptoBuffer & operator=(CryptoBuffer &&other)
std::unique_ptr< T, ArrayDeleter< T > > UniqueArrayPtr
CryptoBuffer(const CryptoBuffer &other)
CryptoBuffer(const ByteBuffer &other)
Array & operator=(Array &&other)
Array(Aws::Vector< Array * > &&toMerge)
bool operator==(const CryptoBuffer &other) const
T const & GetItem(size_t index) const
CryptoBuffer(size_t arraySize=0)
Array & operator=(const Array &other)
Array(const Array &other)
CryptoBuffer(const unsigned char *arrayToCopy, size_t arraySize)
bool operator==(const Array &other) const
Aws::UniqueArrayPtr< T > m_data
T & operator[](size_t index)
JSON (JavaScript Object Notation).