22#ifndef __BINARYDATA_HPP__
23#define __BINARYDATA_HPP__
26#pragma managed(push, off)
35#include <boost/assert.hpp>
124#pragma region Ctors/Dtor
138#pragma region Iterators/accessors
163 return std::numeric_limits<int>().max() /
sizeof(T);
228 BOOST_ASSERT(!empty());
234 BOOST_ASSERT(!empty());
240 BOOST_ASSERT(!empty());
246 BOOST_ASSERT(!empty());
256 if (index < 0 || index >= size())
257 throw std::out_of_range(
"out of range");
258 return (*
this)[index];
263 if (index < 0 || index >= size())
264 throw std::out_of_range(
"out of range");
265 return (*
this)[index];
269#pragma region Mutators
287 void swap(std::vector<T> &that)
292 template <
typename Iter>
293 void assign(
const Iter& first,
const Iter& last)
296 insert(end(), first, last);
303 BOOST_ASSERT(i >= begin() && i <= end());
304 size_t Offset = i - begin();
306 return begin() + Offset;
312 BOOST_ASSERT(i >= begin() && i <= end());
313 size_t OldSize = size();
316 std::copy_backward(begin() + offset, begin() + OldSize, end());
317 std::fill(begin() + offset, begin() + offset + n,
x);
321 template<
typename Iter>
324 BOOST_ASSERT(last >= first);
325 BOOST_ASSERT(i >= begin() && i <= end());
326 size_t count = last - first;
329 size_t offset = i - begin(), old_size = size();
330 resize(old_size + count);
331 for (
iterator j = begin() + old_size,
k = end(); j != begin() + offset; )
332 std::iter_swap(--j, --
k);
333 std::copy(first, last, begin() + offset);
339 std::copy(i + 1, end(), i);
341 return begin() + Offset;
347 iterator i = std::copy(To, end(), From);
349 return begin() + Offset;
354 _resize(elements, FillWith);
382 operator const std::vector<T>&()
const;
390#pragma warning(disable: 4251)
391 std::unique_ptr<Impl> _impl;
418#ifdef __cplusplus_cli
KernelTraitsBase< Kernel >::space_type::abscissa_type x
const_iterator operator+(difference_type n) const
const_iterator & operator+=(difference_type n)
bool operator<=(const const_iterator &that) const
const_iterator & operator--()
bool operator>=(const const_iterator &that) const
const T * operator->() const
bool operator!=(const const_iterator &that) const
const_iterator & operator-=(difference_type n)
difference_type operator-(const const_iterator &rhs) const
bool operator<(const const_iterator &that) const
const_iterator operator++(int)
bool operator==(const const_iterator &that) const
bool operator>(const const_iterator &that) const
const T & operator*() const
const T & operator[](difference_type n) const
const_iterator & operator++()
const_iterator operator-(difference_type n) const
const_iterator operator--(int)
const_iterator(const const_iterator &rhs)
const_iterator(const BinaryData &binaryData, bool begin=true)
iterator(const iterator &rhs)
iterator & operator+=(difference_type n)
iterator(BinaryData &binaryData, bool begin=true)
bool operator!=(const iterator &that) const
iterator operator+(difference_type n) const
iterator & operator-=(difference_type n)
T & operator[](difference_type n) const
difference_type operator-(const iterator &rhs) const
bool operator<=(const iterator &that) const
bool operator>=(const iterator &that) const
bool operator<(const iterator &that) const
bool operator>(const iterator &that) const
bool operator==(const iterator &that) const
iterator operator-(difference_type n) const
A custom vector class that can store its contents in either a std::vector or a cli::array (when compi...
reference at(size_type index)
const_iterator cend() const
BinaryData & operator=(const BinaryData &that)
BinaryData(const BinaryData &source)
iterator erase(iterator From, iterator To)
iterator erase(iterator i)
const_reverse_iterator rend() const
void swap(std::vector< T > &that)
void reserve(size_type n)
reference operator[](size_type index)
std::ptrdiff_t difference_type
void assign(const Iter &first, const Iter &last)
void _reserve(size_type elements)
void _resize(size_type elements, const T &FillWith)
std::reverse_iterator< iterator > reverse_iterator
std::unique_ptr< Impl > _impl
void resize(size_type elements, const T &FillWith)
void resize(size_type elements)
std::reverse_iterator< const_iterator > const_reverse_iterator
void insert(iterator i, size_type n, const T &x)
void * managedStorage() const
const_reverse_iterator crbegin() const
void _alloc(size_type elements, const T &t)
void insert(iterator i, const Iter &first, const Iter &last)
void _assign(const BinaryData &that)
const T & const_reference
void _swap(BinaryData &that)
const_iterator begin() const
BinaryData & operator=(void *cliNumericArray)
void _swap(std::vector< T > &that)
BinaryData(size_type elements=0, T t=T())
size_type _capacity() const
BinaryData(const_iterator first, const_iterator last)
reverse_iterator rbegin()
size_type max_size() const
const_reverse_iterator crend() const
BinaryData & operator=(const std::vector< T > &source)
const_reference front() const
const_reference at(size_type index) const
const_reference back() const
BinaryData(void *cliNumericArray)
void _assign(const std::vector< T > &that)
const_iterator end() const
void swap(BinaryData &that)
const_iterator cbegin() const
const_reverse_iterator rbegin() const
void _resize(size_type elements)
void push_back(const T &value)
iterator insert(iterator i, const T &x=T())
void swap(pwiz::util::BinaryData< T > &lhs, std::vector< T > &rhs)