3#ifndef _aspose_system_array_h_
4#define _aspose_system_array_h_
6#include <system/details/collections_helper.h>
7#include <system/details/comparer_type.h>
8#include <system/details/equality_helper.h>
9#include <system/details/array_view.h>
10#include <system/details/stack_array.h>
11#include <system/object.h>
12#include <system/collections/icomparer.h>
13#include <system/collections/ienumerable.h>
14#include <system/collections/ilist.h>
15#include <system/exceptions.h>
16#include <system/collections/algorithms.h>
17#include <system/converter.h>
18#include <system/predicate.h>
19#include <system/action.h>
20#include <system/select_type.h>
21#include <system/cycles_detection.h>
22#include <system/comparison.h>
23#include <system/collections/read_only_collection.h>
30#include <initializer_list>
39namespace System {
namespace Collections {
namespace ObjectModel {
40template<
typename>
class ReadOnlyCollection;
46 template <
typename X,
typename IdxType>
49 return (**ptr).operator[](
static_cast<int>(idx));
54 template <typename Integral, bool = std::numeric_limits<Integral>::is_signed>
55 struct NegativeValueChecker
60 static void Check(
const Integral &value)
63 throw System::OverflowException(u
"Negative array size");
68 template <
typename Integral>
69 struct NegativeValueChecker<Integral, false>
72 static void Check(
const Integral&) {}
77 template <
typename Integral,
bool = (sizeof(Integral) >
sizeof(int)) || (!std::numeric_limits<Integral>::is_signed && (
sizeof(Integral) ==
sizeof(
int)))>
78 struct IntPositiveOverflowChecker
83 static void Check(
const Integral& value)
85 if (value >=
static_cast<Integral
>((std::numeric_limits<int>::max)()))
86 throw System::OverflowException(u
"Array size too big for signed integer");
91 template <
typename Integral>
92 struct IntPositiveOverflowChecker<Integral, false>
95 static void Check(
const Integral &value) { ASPOSE_UNUSED(value); }
103 template <
typename Integral>
104 int FixArraySize(
const Integral &value)
106 NegativeValueChecker<Integral>::Check(value);
107 IntPositiveOverflowChecker<Integral>::Check(value);
108 return static_cast<int>(value);
119 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
120 RTTI_INFO_TEMPLATE_CLASS(
ThisType, ThisTypeBaseTypesInfo);
166 System::Details::MakeObjectLeakageDetector::SignatureBacktraceSentry signature_sentry;
167 System::Details::MakeObjectLeakageDetector::SetSignature<Array<T>>(init);
169 Detail::OwnNextObject ownershipSentry;
173 ownershipSentry.CreatedSuccessfully(arr);
174 signature_sentry.CreatedSuccessfully(arr);
185 System::Details::MakeObjectLeakageDetector::SignatureBacktraceSentry signature_sentry;
186 System::Details::MakeObjectLeakageDetector::SetSignature<Array<T>>(std::forward<Args>(args)...);
188 Detail::OwnNextObject ownershipSentry;
192 ownershipSentry.CreatedSuccessfully(arr);
193 signature_sentry.CreatedSuccessfully(arr);
204 template <
class T,
class Integral,
class... Args>
205 typename std::enable_if<std::is_integral<Integral>::value,
ArrayPtr<T>>::type
MakeArray(Integral size, Args&&... args)
207 System::Details::MakeObjectLeakageDetector::SignatureBacktraceSentry signature_sentry;
208 System::Details::MakeObjectLeakageDetector::SetSignature<Array<T>>(Details::FixArraySize(size), std::forward<Args>(args)...);
210 Detail::OwnNextObject ownershipSentry;
212 Array<T>*
const arr =
new Array<T>(Details::FixArraySize(size), std::forward<Args>(args)...);
214 ownershipSentry.CreatedSuccessfully(arr);
215 signature_sentry.CreatedSuccessfully(arr);
289 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
290 RTTI_INFO_TEMPLATE_CLASS(
ThisType, ThisTypeBaseTypesInfo);
300 typedef System::Details::CollectionHelpers::ContainerPointerMode<UnderlyingType>
pointer_mode_t;
302 typedef std::vector<UnderlyingType, typename pointer_mode_t::allocator_type>
vector_t;
307#ifdef ASPOSE_GET_SHARED_MEMBERS
308 DEFINE_GET_SHARED_MEMBERS(m_data)
341 return (m_idx < 0 || m_idx >= (int64_t)m_array->
m_data.size())
342 ? System::Default<T>()
343 : m_array->
m_data[(size_t)m_idx];
351 if (m_idx < (int64_t)m_array->
m_data.size())
354 return m_idx < (int64_t)m_array->
m_data.size();
363#ifdef __DBG_FOR_EACH_MEMBER
367 void DBG_for_each_member(DBG::for_each_member_visitor &visitor)
const override
369 visitor.add_self(
this);
370 visitor.add_member(
this, m_array.
get_shared(),
"m_array");
374 const char* DBG_class_name()
const override {
return "Array<T>::Enumerator"; }
378#ifdef ASPOSE_GET_SHARED_MEMBERS
380 virtual void GetSharedMembers(System::Object::shared_members_type& result)
const override
382 Object::GetSharedMembers(result);
383 result.Add(
"System::Array<T>::Enumerator::m_array", m_array);
389 Array() : m_data(m_pointer_mode.GetAllocator()) {}
394 Array(
int count,
const T& init = T()) : m_data(count, static_cast<
UnderlyingType>(init), m_pointer_mode.GetAllocator()) { }
400 template <
typename ValueType>
401 Array(
typename std::enable_if<std::is_arithmetic<T>::value && std::is_arithmetic<ValueType>::value && std::is_convertible<ValueType, T>::value,
int>::type count,
ValueType init)
402 :
Array(count, ASPOSECPP_CHECKED_CAST(T, init)) {}
407 Array(
int count,
const T inits[]) : m_data(count, static_cast<
UnderlyingType>(T()), m_pointer_mode.GetAllocator())
409 for (
int i = 0; i < count; ++i)
410 m_data[i] = inits[i];
415 Array(
vector_t&& value) : m_data(std::move(value), m_pointer_mode.GetAllocator()) {}
419 Array(
const vector_t &assgn) : m_data(assgn, m_pointer_mode.GetAllocator()) {}
425 template <typename Q, typename = typename std::enable_if<std::is_same<Q, T>::value && !std::is_same<std::vector<Q>, vector_t>::value, std::vector<Q>>::type>
427 : m_data(value.begin(), value.end(), m_pointer_mode.GetAllocator())
434 template <typename Q, typename = typename std::enable_if<std::is_same<Q, T>::value && !std::is_same<std::vector<Q>, vector_t>::value, std::vector<Q>>::type>
436 : m_data(m_pointer_mode.GetAllocator())
443 Array(std::initializer_list<UnderlyingType> init) : m_data(init, m_pointer_mode.GetAllocator()) {}
448 template <std::
size_t InitArraySize>
449 Array(
const std::array<UnderlyingType, InitArraySize> &init) :
450 Array(init, static_cast<std::make_index_sequence<InitArraySize>*>(nullptr))
455 Array(std::initializer_list<bool> init,
int = 0) : m_data(m_pointer_mode.GetAllocator())
457 for (
auto it = init.begin(); it != init.end(); ++it)
467 return MakeObject<Enumerator>(std::move(
MakeSharedPtr(
this)));
483 virtual void Add(
const T&)
override
485 throw NotSupportedException(u
"Array as ICollection<T>::Add");
492 throw NotSupportedException(u
"Array as ICollection<T>::Clear");
499 m_pointer_mode.SetWeak(argument, m_data);
507 template <
typename Q = T>
508 auto ContainsImpl(
const Q* item)
const ->
decltype(std::declval<UnderlyingType>() == *item, void(0), bool())
510 return std::find_if(m_data.begin(), m_data.end(),
511 [&item](
const T& value) { return Details::AreEqual(value, *item); }) != m_data.end();
516 bool ContainsImpl(...)
const
518 throw NotImplementedException(ASPOSE_CURRENT_FUNCTION);
524 virtual bool Contains(
const T& item)
const override
526 return ContainsImpl(&item);
533 throw NotSupportedException(u
"Array as ICollection<T>::Remove");
552 this->CopyTo<T>(arr,
static_cast<int64_t
>(arrayIndex));
559 template <std::size_t ...InitArrayIndexes>
560 Array(
const std::array<UnderlyingType,
sizeof...(InitArrayIndexes)> &init, std::index_sequence<InitArrayIndexes...>*) :
561 m_data({ init[InitArrayIndexes]... }, m_pointer_mode.GetAllocator()) {}
568 template <
typename Q = T>
569 auto IndexOfImpl(
const Q* item)
const ->
decltype(std::declval<UnderlyingType>() == *item, void(0), int())
571 auto it = std::find_if(m_data.begin(), m_data.end(), [&item](
const T& value) { return Details::AreEqual(value, *item); });
573 return (it != m_data.end()) ?
static_cast<int>(it - m_data.begin()) : -1;
578 int IndexOfImpl(...)
const
580 throw NotImplementedException(ASPOSE_CURRENT_FUNCTION);
587 virtual int IndexOf(
const T& item)
const override
589 return IndexOfImpl(&item);
594 virtual void Insert(
int,
const T&)
override
596 throw NotSupportedException(u
"Array as IList<T>::Insert");
603 throw NotSupportedException(u
"Array as IList<T>::RemoveAt");
611 return operator[](index);
617 virtual void idx_set(
int index, T value)
override
619 operator[](index) = value;
629 for (
size_t i = 0; i < m_data.size(); ++i)
630 m_data[i] = inits[i];
638 for (
size_t i = 0; i < m_data.size(); ++i)
647 using namespace Collections::Generic::Details;
648 if (IsOutOfBounds(index, m_data)) {
649 throw ArgumentOutOfRangeException(u
"index");
651 return m_data[
static_cast<typename vector_t::size_type
>(index)];
659 using namespace Collections::Generic::Details;
660 if (IsOutOfBounds(index, m_data)) {
661 throw ArgumentOutOfRangeException(u
"index");
663 return m_data[
static_cast<typename vector_t::size_type
>(index)];
671 System::ArrayPtr<T> clone = System::MakeObject< System::Array<T> >(
static_cast<int>(m_data.size()));
672 std::copy(m_data.begin(), m_data.end(), clone->data().
begin());
679 return System::MakeObject<Collections::ObjectModel::ReadOnlyCollection<T>>(array);
693 template<
typename Y,
typename Z>
696 throw NotImplementedException();
704 return static_cast<int>(GetLongLength(dimension));
712 return upper_bound(m_data, dimension) + 1;
720 ASPOSE_UNUSED(dimension);
729 return upper_bound(m_data, dimension);
738 template <
typename InputType,
typename OutputType>
743 throw System::ArgumentNullException(u
"arr");
746 if (converter.IsNull())
748 throw System::ArgumentNullException(u
"converter");
752 for (
int i = 0; i < input_array->get_Length(); i++)
754 newArray[i] = converter(input_array[i]);
765 template <
typename InputType,
typename OutputType>
777 if (!arr || match.IsNull())
779 throw System::ArgumentNullException(u
"arr or match");
782 for (
int i = 0; i < arr->get_Length(); i++)
796 if (!arr || match.IsNull())
798 throw System::ArgumentNullException(u
"arr or match");
801 for (
auto val: arr->
m_data)
813 if (!arr || match.IsNull())
815 throw System::ArgumentNullException(u
"arr or match");
820 for (
auto val : arr->
m_data)
822 result->data().push_back(val);
833 if (!arr || match.IsNull())
835 throw System::ArgumentNullException(u
"arr or match");
837 for (
auto val : arr->
m_data)
844 int32_t
get_Rank()
const {
throw System::NotImplementedException(ASPOSE_CURRENT_FUNCTION); };
851 const int64_t len64 = get_LongLength();
853 if (len64 > (std::numeric_limits<int32_t>::max)()) {
854 throw OverflowException();
856 return static_cast<int32_t
>(len64);
863 return GetSizeTLength();
870 return recursive_size(m_data);
875 int Count()
const {
return get_Length(); }
882 template<
typename DstType>
885 this->CopyTo(dstArray, 0, dstIndex, GetSizeTLength());
893 template<
typename DstType>
894 void CopyTo(
const System::Details::ArrayView<DstType> &dstArray, int64_t dstIndex)
const
896 this->CopyTo(dstArray, 0, dstIndex, GetSizeTLength());
907 template<
typename DstType>
910 using namespace Collections::Generic::Details;
913 throw ArgumentNullException(u
"dstArray");
915 if (srcIndex < 0 || dstIndex < 0 || count < 0) {
916 throw ArgumentOutOfRangeException(u
"srcIndex, dstIndex or count");
918 if (IsOutOfSize(srcIndex + count, m_data)
919 || IsOutOfSize(dstIndex + count, dstArray->data())) {
920 throw ArgumentException(u
"srcIndex, dstIndex or count");
925 if (dstArray.
GetObjectOrNull() == (
Object*)(
this) && dstIndex > srcIndex && dstIndex < srcIndex + count)
928 m_data.begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, srcIndex)
929 , m_data.begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, srcIndex) + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, count)
930 , dstArray->data().
begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, dstIndex) + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, count)
936 m_data.begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, srcIndex)
937 , m_data.begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, srcIndex) + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, count)
938 , dstArray->data().
begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, dstIndex)
951 template<
typename DstType>
952 void CopyTo(
const System::Details::ArrayView<DstType> &dstArray, int64_t srcIndex, int64_t dstIndex, int64_t count)
const
954 using namespace Collections::Generic::Details;
957 throw ArgumentNullException(u
"dstArray");
959 if (srcIndex < 0 || dstIndex < 0 || count < 0) {
960 throw ArgumentOutOfRangeException(u
"srcIndex, dstIndex or count");
962 if (IsOutOfSize(srcIndex + count, m_data)
963 || dstIndex + count > dstArray.get_Length()) {
964 throw ArgumentException(u
"srcIndex, dstIndex or count");
967 if (dstArray.data() == this->data().data()
968 && dstIndex > srcIndex && dstIndex < srcIndex + count)
971 m_data.begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, srcIndex)
972 , m_data.begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, srcIndex) + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, count)
973 , dstArray.begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, dstIndex) + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, count)
979 m_data.begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, srcIndex)
980 , m_data.begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, srcIndex) + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, count)
981 , dstArray.begin() + ASPOSECPP_CHECKED_CAST(std::ptrdiff_t, dstIndex)
992 throw ArgumentNullException(u
"action");
994 for (
auto val : arr->
m_data)
1004 template<
typename ArrayType,
typename ValueType>
1007 return IndexOf(arr, value, 0);
1017 template<
typename ArrayType,
typename ValueType>
1020 return IndexOf(arr, value, startIndex, arr->get_Length() - startIndex);
1031 template<
typename ArrayType,
typename ValueType>
1034 using namespace Collections::Generic::Details;
1036 throw ArgumentNullException(u
"arr");
1038 if (startIndex < 0 || count < 0 || IsOutOfSize(startIndex + count, arr->data())) {
1039 throw ArgumentOutOfRangeException(u
"startIndex or count");
1042 auto begin = arr->data().
begin() + startIndex;
1043 auto end = begin + count;
1045 std::find_if(begin, end, [&value](
const ArrayType& item) {
return Details::AreEqual(item, value); });
1047 return (it != end) ?
static_cast<int>(it - arr->data().
begin()) : -1;
1058 template<
typename ArrayType,
typename ValueType>
1061 using namespace Collections::Generic::Details;
1063 throw ArgumentNullException(u
"arr");
1065 if (startIndex < 0 || count < 0
1066 || IsOutOfSize(startIndex, arr->data()) || IsOutOfSize(count, arr->data())
1067 || (startIndex - count + 1) < 0) {
1068 throw ArgumentOutOfRangeException(u
"startIndex or count");
1070 auto rbegin = arr->data().rbegin() + arr->data().size() - startIndex - 1;
1071 auto rend = rbegin + count;
1072 auto rit = std::find_if(rbegin, rend, [&value](
const ArrayType& item) {
return Details::AreEqual(item, value); });
1074 return (rit != rend) ? ASPOSECPP_CHECKED_CAST(
int, rit.base() - arr->data().
begin() - 1) : -1;
1084 template<
typename ArrayType,
typename ValueType>
1087 return LastIndexOf(items, value, startIndex, (items->get_Length() == 0) ? 0 : startIndex + 1);
1096 template<
typename ArrayType,
typename ValueType>
1099 return LastIndexOf(items, value, items->get_Length() - 1, items->get_Length());
1107 template<
typename Type>
1110 using namespace Collections::Generic::Details;
1112 throw ArgumentNullException(u
"arr");
1114 if (startIndex < 0 || count < 0 || IsOutOfSize(startIndex + count, arr->data())) {
1115 throw ArgumentOutOfRangeException(u
"startIndex or count");
1118 for (
auto i = 0; i < count; ++i)
1119 arr->data().at(startIndex + i) = Type();
1133 template <
typename SrcType,
typename DstType>
1138 throw ArgumentNullException(u
"srcArray");
1140 srcArray->CopyTo(dstArray, srcIndex, dstIndex, count);
1147 template<
typename SrcType,
typename DstType>
1152 throw ArgumentNullException(u
"srcArray");
1154 srcArray->CopyTo(dstArray, 0, 0, count);
1161 template<
typename SrcType,
typename DstType>
1162 static void Copy(System::Details::ArrayView<SrcType> srcArray,
1166 throw ArgumentNullException(u
"srcArray");
1168 srcArray.CopyTo(dstArray, 0, 0, count);
1175 template<
typename SrcType,
typename DstType>
1177 System::Details::ArrayView<DstType> dstArray, int64_t count)
1180 throw ArgumentNullException(u
"srcArray");
1182 srcArray->CopyTo(dstArray, 0, 0, count);
1189 template<
typename SrcType,
typename DstType>
1190 static void Copy(System::Details::ArrayView<SrcType> srcArray,
1191 System::Details::ArrayView<DstType> dstArray, int64_t count)
1194 throw ArgumentNullException(u
"srcArray");
1196 srcArray.CopyTo(dstArray, 0, 0, count);
1203 template<
typename SrcType, std::
size_t N,
typename DstType>
1204 static void Copy(System::Details::StackArray<SrcType, N> &srcArray,
1207 Copy(
static_cast<System::Details::ArrayView<SrcType>
>(srcArray), dstArray, count);
1214 template<
typename SrcType,
typename DstType, std::
size_t N>
1216 System::Details::StackArray<DstType, N> &dstArray, int64_t count)
1218 Copy(srcArray,
static_cast<System::Details::ArrayView<DstType>
>(dstArray), count);
1225 template<
typename SrcType, std::
size_t NS,
typename DstType, std::
size_t ND>
1226 static void Copy(System::Details::StackArray<SrcType, NS> &srcArray,
1227 System::Details::StackArray<DstType, ND> &dstArray, int64_t count)
1229 Copy(
static_cast<System::Details::ArrayView<SrcType>
>(srcArray),
1230 static_cast<System::Details::ArrayView<DstType>
>(dstArray), count);
1241 template<
typename SrcType,
typename DstType>
1246 throw ArgumentNullException(u
"srcArray");
1248 srcArray->CopyTo(dstArray, srcIndex, dstIndex, count);
1259 template<
typename SrcType,
typename DstType>
1260 static void Copy(System::Details::ArrayView<SrcType> srcArray, int64_t srcIndex,
1264 throw ArgumentNullException(u
"srcArray");
1266 srcArray.CopyTo(dstArray, srcIndex, dstIndex, count);
1277 template<
typename SrcType,
typename DstType>
1279 System::Details::ArrayView<DstType> dstArray, int64_t dstIndex, int64_t count)
1282 throw ArgumentNullException(u
"srcArray");
1284 srcArray->CopyTo(dstArray, srcIndex, dstIndex, count);
1295 template<
typename SrcType,
typename DstType>
1296 static void Copy(System::Details::ArrayView<SrcType> srcArray, int64_t srcIndex,
1297 System::Details::ArrayView<DstType> dstArray, int64_t dstIndex, int64_t count)
1300 throw ArgumentNullException(u
"srcArray");
1302 srcArray.CopyTo(dstArray, srcIndex, dstIndex, count);
1313 template<
typename SrcType, std::
size_t N,
typename DstType>
1314 static void Copy(System::Details::StackArray<SrcType, N> &srcArray, int64_t srcIndex,
1317 Copy(
static_cast<System::Details::ArrayView<SrcType>
>(srcArray), srcIndex, dstArray, dstIndex, count);
1328 template<
typename SrcType,
typename DstType, std::
size_t N>
1330 System::Details::StackArray<DstType, N> &dstArray, int64_t dstIndex, int64_t count)
1332 Copy(srcArray, srcIndex,
static_cast<System::Details::ArrayView<DstType>
>(dstArray), dstIndex, count);
1343 template<
typename SrcType, std::
size_t NS,
typename DstType, std::
size_t ND>
1344 static void Copy(System::Details::StackArray<SrcType, NS> &srcArray, int64_t srcIndex,
1345 System::Details::StackArray<DstType, ND> &dstArray, int64_t dstIndex, int64_t count)
1347 Copy(
static_cast<System::Details::ArrayView<SrcType>
>(srcArray), srcIndex,
1348 static_cast<System::Details::ArrayView<DstType>
>(dstArray), dstIndex, count);
1359 template<
typename SrcType,
typename DstType, std::
size_t ND>
1360 static void Copy(System::Details::ArrayView<SrcType> &srcArray, int64_t srcIndex,
1361 System::Details::StackArray<DstType, ND> &dstArray, int64_t dstIndex, int64_t count)
1363 Copy(srcArray, srcIndex,
1364 static_cast<System::Details::ArrayView<DstType>
>(dstArray), dstIndex, count);
1369 template<
typename Type>
1372 Sort(arr, 0, arr->get_Length());
1379 template<
typename Type>
1382 using namespace Collections::Generic::Details;
1384 throw ArgumentNullException(u
"arr");
1386 if (startIndex < 0 || count < 0 || IsOutOfSize(startIndex + count, arr->data())) {
1387 throw ArgumentOutOfRangeException(u
"startIndex or count");
1390 auto begin = arr->data().
begin() + startIndex;
1391 auto end = begin + count;
1393 std::sort(begin, end, Collections::Generic::Details::ComparerType<Type>());
1399 template<
typename Type>
1403 std::sort(arr->data().
begin(), arr->data().
end(), adapter);
1408 template<
typename Type,
typename Y>
1411 throw NotImplementedException();
1415 template<
typename Type>
1418 std::sort(arr->data().
begin(), arr->data().
end(), comparison);
1427 template<
typename TKey,
typename TValue>
1430 if (keys ==
nullptr)
1431 throw ArgumentNullException(u
"keys");
1433 Sort(keys, items, 0, keys->get_Length());
1444 template<
typename TKey,
typename TValue>
1447 if (keys ==
nullptr)
1448 throw ArgumentNullException(u
"keys");
1449 if (index < 0 || length < 0)
1450 throw ArgumentOutOfRangeException(length < 0 ? u
"length" : u
"index");
1451 if (index + length > keys->Count() || (items !=
nullptr && index + length > items->Count()))
1452 throw ArgumentException();
1454 if (items ==
nullptr)
1456 typename std::vector<TKey>::iterator keys_begin = keys->data().
begin() + index;
1457 typename std::vector<TKey>::iterator keys_end = keys_begin + length;
1459 std::sort(keys_begin, keys_end, Collections::Generic::Details::ComparerType<TKey>());
1464 std::multimap<TKey, TValue, Collections::Generic::Details::ComparerType<TKey>> map;
1465 for (
int i = index; i < index + length; ++i)
1466 map.insert(std::make_pair(keys[i], items[i]));
1468 auto map_iter = map.begin();
1469 for (
int i = index; (i < index + length) && (map_iter != map.end()); ++i, ++map_iter)
1471 keys[i] = map_iter->first;
1472 items[i] = map_iter->second;
1479 template<
typename Type>
1489 template<
typename Type>
1492 using namespace Collections::Generic::Details;
1494 throw ArgumentNullException(u
"arr");
1496 if (startIndex < 0 || count < 0 || IsOutOfSize(startIndex + count, arr->data())) {
1497 throw ArgumentOutOfRangeException(u
"startIndex or count");
1500 std::reverse(arr->
m_data.begin() + startIndex, arr->
m_data.begin() + startIndex + count);
1506 template<
typename Type>
1510 throw ArgumentOutOfRangeException(u
"new_size");
1518 auto new_array = MakeObject<Array<T>>(new_size);
1519 std::copy(arr->data_ptr(), arr->data_ptr() + (std::ptrdiff_t)std::min(new_size, arr->get_Length()), new_array->data_ptr());
1525 arr->
m_data.resize((
typename vector_t::size_type)new_size);
1531 arr = MakeObject<Array<T>>(new_size);
1540 using namespace Collections::Generic::Details;
1541 if (IsOutOfBounds(index, m_data)) {
1542 throw ArgumentOutOfRangeException(u
"index");
1544 m_data[index] = value;
1583 return m_data.begin();
1591 return m_data.begin();
1599 return m_data.cbegin();
1607 return m_data.end();
1615 return m_data.end();
1623 return m_data.cend();
1632 return m_data.rbegin();
1641 return m_data.rbegin();
1650 return m_data.crbegin();
1659 return m_data.rend();
1668 return m_data.rend();
1677 return m_data.crend();
1697 return *std::min_element(m_data.cbegin(), m_data.cend());
1704 return *std::max_element(m_data.cbegin(), m_data.cend());
1713 for (
int i = 0; i < arr->get_Length(); i++)
1724 return new System::Details::NativeIteratorWrapper<T, iterator>(begin(), end());
1729 return new System::Details::NativeIteratorWrapper<T, iterator>(end(), end());
1734 return new System::Details::NativeConstIteratorWrapper<T, const_iterator>(begin(), end());
1739 return new System::Details::NativeConstIteratorWrapper<T, const_iterator>(end(), end());
1748 template <
typename ErrType>
1749 static int upper_bound(ErrType arr,
int dim)
1753 throw System::IndexOutOfRangeException();
1761 template <
typename VType,
typename Alloc>
1762 static int upper_bound(
const std::vector<VType, Alloc> &arr,
int dim)
1765 return (
int)arr.size() - 1;
1770 return upper_bound(arr[0], dim - 1);
1778 template <
typename U,
typename Alloc>
1779 static size_t recursive_size(
const std::vector<U, Alloc>& v)
1791 template <
typename U,
typename Alloc1,
typename Alloc2>
1792 static size_t recursive_size(
const std::vector<std::vector<U, Alloc1>, Alloc2>& v)
1795 for (
const auto &i : v)
1796 rv += recursive_size(i);
1805#ifdef __DBG_FOR_EACH_MEMBER
1809 void DBG_for_each_member(DBG::for_each_member_visitor &visitor)
const override
1811 visitor.add_self(
this);
1812 DBG::for_each_of_Object(
this, m_data, visitor);
1815 const char* DBG_class_name()
const override {
return "Array<T>"; }
1820 template <
typename TTo>
1821 struct CastResult<
Array<TTo>>
1824 typedef ArrayPtr<TTo>
type;
1833 template <
typename T>
1834 inline Array<T>* CreateArray(Array<T>*)
1836 return new Array<T>(0);
Implements IEnumerator interface that enables enumeration of elements of an Array object....
Definition: array.h:321
virtual ~Enumerator()
Destructor.
Definition: array.h:336
Enumerator(const SharedPtr< Array< T > > &arr)
Constructs a new Enumerator object that represents the specified array.
Definition: array.h:333
virtual MakeConstRef_t< T > get_Current() const override
Returns a copy of the current element.
Definition: array.h:339
virtual bool MoveNext() override
Checks if the current element's index does not point to the last element in the array and advances it...
Definition: array.h:349
virtual void Reset() override
Resets the current element's index.
Definition: array.h:358
The dummy for System.Array class (abstract base class for all arrays) May be filled with functionalit...
Definition: array.h:115
virtual void * raw_data_ptr()=0
Returns pointer to the first element of single-dimension array. For multi-dimensional arrays result u...
virtual int32_t get_Length() const =0
Returns 32-bit integer that represents the total number of all elements in all dimensions of the arra...
Class that represents an array data structure. Objects of this class should only be allocated using S...
Definition: array.h:285
static System::ArrayPtr< T > FindAll(System::ArrayPtr< T > arr, System::Predicate< T > match)
Retrieves all the elements that match the conditions defined by the specified predicate.
Definition: array.h:811
static void Clear(const ArrayPtr< Type > &arr, int startIndex, int count)
Replaces count values starting at the startIndex index in the specified array with default values.
Definition: array.h:1108
static ArrayPtr< OutputType > ConvertAll(ArrayPtr< InputType > input_array, std::function< OutputType(InputType)> converter)
Constructs a new Array object and fills it with elements of the specified array converted to OutputTy...
Definition: array.h:766
const_reverse_iterator crbegin() const noexcept
Returns a reverse iterator to the first element of the reversed container. It corresponds to the last...
Definition: array.h:1648
static int IndexOf(const ArrayPtr< ArrayType > &arr, const ValueType &value)
Determines the index of the first occurrence of specified item in the array.
Definition: array.h:1005
void SetValue(const T &value, int index)
Sets value of the element at specified index.
Definition: array.h:1538
SharedPtr< Collections::Generic::IEnumerator< T > > EnumeratorPtr
An alias for shared pointer type pointing to IEnumerator object containing elements of type T.
Definition: array.h:314
static void ConstrainedCopy(const ArrayPtr< SrcType > &srcArray, int64_t srcIndex, const ArrayPtr< DstType > &dstArray, int64_t dstIndex, int64_t count)
Copies a range of elements from an System.Array starting at the specified source.
Definition: array.h:1134
vector_t::iterator iterator
Iterator type.
Definition: array.h:1570
static void Sort(const ArrayPtr< Type > &arr, const SharedPtr< System::Collections::Generic::IComparer< T > > &comparator)
Sorts elements in the specified array using specified comparer.
Definition: array.h:1400
reverse_iterator rbegin() noexcept
Returns a reverse iterator to the first element of the reversed container. It corresponds to the last...
Definition: array.h:1630
UnderlyingType Min() const
Finds the smallest element in the array using operator<() to compare elements.
Definition: array.h:1695
Array(std::vector< Q > &&value)
Constructs an Array object and fills it with values moved from an std::vector object whose values' ty...
Definition: array.h:435
virtual bool Contains(const T &item) const override
Determines if the specified item is in the array.
Definition: array.h:524
vector_t::const_reverse_iterator const_reverse_iterator
Const reverse iterator type.
Definition: array.h:1576
const UnderlyingType * data_ptr() const
Returns a constant raw pointer to the beginning of the memory buffer where the array elements are sto...
Definition: array.h:1563
~Array() override
Destructor.
Definition: array.h:1803
virtual void Clear() override
Not supported because the array represented by the current object is read-only.
Definition: array.h:490
static void Copy(System::Details::ArrayView< SrcType > srcArray, int64_t srcIndex, System::Details::ArrayView< DstType > dstArray, int64_t dstIndex, int64_t count)
Copies a specified number of elements from the source array view starting at the specified index to t...
Definition: array.h:1296
iterator begin() noexcept
Returns an iterator to the first element of the container. If the container is empty,...
Definition: array.h:1581
virtual int IndexOf(const T &item) const override
Determines the index of the first occurrence of the specified item in the array.
Definition: array.h:587
static void Sort(const ArrayPtr< Type > &arr, const SharedPtr< System::Collections::Generic::IComparer< Y > > &comparator)
NOT IMPLEMENTED.
Definition: array.h:1409
vector_t m_data
The storage for array's elements.
Definition: array.h:306
static T Find(System::ArrayPtr< T > arr, System::Predicate< T > match)
Searches for the first element in the specified array that satisfies the conditions of the specified ...
Definition: array.h:794
ArrayPtr< T > Init(const T inits[])
Fills the array represented by the current object with the values from the specified array.
Definition: array.h:627
static void Sort(const ArrayPtr< TKey > &keys, const ArrayPtr< TValue > &items, int index, int length)
Sorts two arrays one containing keys and the other - corresponding items, based on the values of arra...
Definition: array.h:1445
int GetLength(int dimension)
Returns the number of elements in the specified dimension.
Definition: array.h:702
virtual EnumeratorPtr GetEnumerator() override
Returns a pointer to Enumerator object that provides IEnumerator interface to elements of the array r...
Definition: array.h:465
Array(vector_t &&value)
Move constructor.
Definition: array.h:415
vector_t::pointer data_ptr()
Returns a raw pointer to the beginning of the memory buffer where the array elements are stored.
Definition: array.h:1554
static void Reverse(const ArrayPtr< Type > &arr)
Reverses elements in the specified array.
Definition: array.h:1480
static void Copy(System::Details::StackArray< SrcType, NS > &srcArray, int64_t srcIndex, System::Details::StackArray< DstType, ND > &dstArray, int64_t dstIndex, int64_t count)
Copies a specified number of elements from the source array on stack starting at the specified index ...
Definition: array.h:1344
const vector_t & data() const
Returns a constant reference to the internal data structure used to store the array elements.
Definition: array.h:1551
static void Copy(System::Details::ArrayView< SrcType > &srcArray, int64_t srcIndex, System::Details::StackArray< DstType, ND > &dstArray, int64_t dstIndex, int64_t count)
Copies a specified number of elements from the source array view starting at the specified index to t...
Definition: array.h:1360
Array(std::initializer_list< bool > init, int=0)
Constructs an Array object and fills it with values from the specified initializer list containing el...
Definition: array.h:455
static int IndexOf(const ArrayPtr< ArrayType > &arr, const ValueType &value, int startIndex, int count)
Determines the index of the first occurrence of the specified item in a range of items of the array s...
Definition: array.h:1032
static void Copy(const ArrayPtr< SrcType > &srcArray, System::Details::ArrayView< DstType > dstArray, int64_t count)
Copies the specified number of elements from the source array to the destination array view.
Definition: array.h:1176
SharedPtr< Collections::Generic::IEnumerable< T > > EnumerablePtr
An alias for shared pointer type pointing to IEnumerable object containing elements of type T.
Definition: array.h:312
Array(const std::vector< Q > &value)
Constructs an Array object and fills it with values copied from an std::vector object whose values' t...
Definition: array.h:426
System::Details::CollectionHelpers::ContainerPointerMode< UnderlyingType > pointer_mode_t
Type to keep information on whether to treat array elements as shared or weak pointers,...
Definition: array.h:300
void * raw_data_ptr() override
Returns pointer to the first element of single-dimension array. For multi-dimensional arrays result u...
Definition: array.h:1567
void CopyTo(const ArrayPtr< DstType > &dstArray, int64_t srcIndex, int64_t dstIndex, int64_t count) const
Copies a specified number of elements from the current array starting at specified position to specif...
Definition: array.h:908
System::Details::VirtualizedIteratorBase< T > * virtualizeEndConstIterator() const override
Gets the implementation of end const iterator for the current container.
Definition: array.h:1737
ArrayPtr< T > Clone()
Clones the array.
Definition: array.h:669
virtual void Add(const T &) override
Not supported because the array represented by the current object is read-only.
Definition: array.h:483
vector_t & data()
Returns a reference to the internal data structure used to store the array elements.
Definition: array.h:1548
void CopyTo(const ArrayPtr< DstType > &dstArray, int64_t dstIndex) const
Copies all elements of the current array to the specified destination array. Elements are inserted in...
Definition: array.h:883
void CopyTo(const System::Details::ArrayView< DstType > &dstArray, int64_t dstIndex) const
Copies all elements of the current array to the specified destination array view. Elements are insert...
Definition: array.h:894
void CopyTo(const System::Details::ArrayView< DstType > &dstArray, int64_t srcIndex, int64_t dstIndex, int64_t count) const
Copies a specified number of elements from the current array starting at specified position to specif...
Definition: array.h:952
virtual bool Remove(const T &) override
Not supported because the array represented by the current object is read-only.
Definition: array.h:531
const_reverse_iterator rend() const noexcept
Returns a reverse iterator to the element following the last element of the reversed container....
Definition: array.h:1666
Array(const vector_t &assgn)
Copy constructor.
Definition: array.h:419
iterator end() noexcept
Returns an iterator to the element following the last element of the container. This element acts as ...
Definition: array.h:1605
static int BinarySearch(System::ArrayPtr< T > arr, const T &item)
Performs binary search in the sorted array.
Definition: array.h:686
UnderlyingType Max() const
Finds the largest element in the array using operator<() to compare elements.
Definition: array.h:1702
int32_t get_Rank() const
NOT IMPLEMENTED.
Definition: array.h:844
const_iterator end() const noexcept
Returns an iterator to the element following the last element of the const-qualified container....
Definition: array.h:1613
static ArrayPtr< OutputType > ConvertAll(ArrayPtr< InputType > input_array, Converter< InputType, OutputType > converter)
Constructs a new Array object and fills it with elements of the specified array converted to OutputTy...
Definition: array.h:739
static int IndexOf(const ArrayPtr< ArrayType > &arr, const ValueType &value, int startIndex)
Determines the index of the first occurrence of the specified item in the array starting from the spe...
Definition: array.h:1018
static bool Exists(ArrayPtr< T > arr, std::function< bool(T)> match)
Determines if the specified Array object contains an element that satisfies requirements of the speci...
Definition: array.h:1711
T ValueType
Alias for the type of the elements of the array.
Definition: array.h:294
static void Copy(System::Details::ArrayView< SrcType > srcArray, System::Details::ArrayView< DstType > dstArray, int64_t count)
Copies the specified number of elements from the source array view to the destination array view.
Definition: array.h:1190
static bool TrueForAll(System::ArrayPtr< T > arr, System::Predicate< T > match)
Determines whether all elements in the specified array satisfy the conditions defined by specified pr...
Definition: array.h:831
static int FindIndex(System::ArrayPtr< T > arr, System::Predicate< T > match)
Searches for the first element in the specified array that satisfies the conditions of the specified ...
Definition: array.h:775
static int LastIndexOf(const ArrayPtr< ArrayType > &arr, const ValueType &value, int startIndex, int count)
Determines the index of the last occurrence of the specified item in a range of items of the array sp...
Definition: array.h:1059
static void Copy(const ArrayPtr< SrcType > &srcArray, const ArrayPtr< DstType > &dstArray, int64_t count)
Copies the specified number of elements from the source array to the destination array.
Definition: array.h:1148
vector_t::reverse_iterator reverse_iterator
Reverse iterator type.
Definition: array.h:1574
Array(int count, const T &init=T())
Filling constructor.
Definition: array.h:394
int64_t get_LongLength() const
Returns 64-bit integer that represents the total number of all elements in all dimensions of the arra...
Definition: array.h:861
static void Copy(System::Details::StackArray< SrcType, NS > &srcArray, System::Details::StackArray< DstType, ND > &dstArray, int64_t count)
Copies the specified number of elements from the source array on stack to the destination array on st...
Definition: array.h:1226
System::Details::VirtualizedIteratorBase< T > * virtualizeBeginConstIterator() const override
Gets the implementation of begin const iterator for the current container.
Definition: array.h:1732
static void Sort(const ArrayPtr< Type > &arr, const System::Comparison< T > &comparison)
Sorts elements in the specified array using specified comparison.
Definition: array.h:1416
UnderlyingType const & operator[](int index) const
Returns an item at the specified index.
Definition: array.h:657
static SharedPtr< Collections::ObjectModel::ReadOnlyCollection< T > > AsReadOnly(const SharedPtr< Array< T > > &array)
Casts array to read only collection.
Definition: array.h:677
virtual void CopyTo(ArrayPtr< T > arr, int arrayIndex) override
Copies all elements of the current array to the specified destination array. Elements are inserted in...
Definition: array.h:550
virtual bool get_IsReadOnly() const override
Indicates whether the array is read-only.
Definition: array.h:541
static void Sort(const ArrayPtr< TKey > &keys, const ArrayPtr< TValue > &items)
Sorts two arrays one containing keys and the other - corresponding items, based on the values of arra...
Definition: array.h:1428
void Initialize()
Fills the array with the default constructed objects of type T.
Definition: array.h:636
Array(int count, const T inits[])
Filling constructor.
Definition: array.h:407
virtual T idx_get(int index) const override
Returns the item at the specified index.
Definition: array.h:609
int GetLowerBound(int dimension) const
Returns the lower bound of the specified dimension.
Definition: array.h:718
System::Details::VirtualizedIteratorBase< T > * virtualizeEndIterator() override
Gets the implementation of end iterator for the current container.
Definition: array.h:1727
static void ForEach(const ArrayPtr< T > &arr, System::Action< T > action)
Performs specified action on each element of the specified array.
Definition: array.h:989
int64_t GetLongLength(int dimension)
Returns the number of elements in the specified dimension as 64-bit integer.
Definition: array.h:710
static void Copy(System::Details::StackArray< SrcType, N > &srcArray, int64_t srcIndex, const ArrayPtr< DstType > &dstArray, int64_t dstIndex, int64_t count)
Copies a specified number of elements from the source array on stack starting at the specified index ...
Definition: array.h:1314
static int BinarySearch(System::ArrayPtr< T > arr, const Y &item, const SharedPtr< Collections::Generic::IComparer< Z > > &comparer)
NOT IMPLEMENTED.
Definition: array.h:694
static int LastIndexOf(const ArrayPtr< ArrayType > &items, const ValueType &value, int startIndex)
Determines the index of the last occurrence of the specified item in the array starting from the spec...
Definition: array.h:1085
static void Copy(const ArrayPtr< SrcType > &srcArray, System::Details::StackArray< DstType, N > &dstArray, int64_t count)
Copies the specified number of elements from the source array to the destination array on stack.
Definition: array.h:1215
virtual int get_Count() const override
Returns the size of the array.
Definition: array.h:476
typename System::Details::SelectType< T >::type UnderlyingType
Alias for the type used to represent each element of the array.
Definition: array.h:296
static void Sort(const ArrayPtr< Type > &arr)
Sorts elements in the specified array using default comparer.
Definition: array.h:1370
virtual void RemoveAt(int) override
Not supported because array represented by the current object is read-only.
Definition: array.h:601
virtual void idx_set(int index, T value) override
Sets the specified value as the item of the array at the specified index.
Definition: array.h:617
const_iterator cbegin() const noexcept
Returns an iterator to the first const-qualified element of the container. If the container is empty,...
Definition: array.h:1597
static void Copy(System::Details::ArrayView< SrcType > srcArray, const ArrayPtr< DstType > &dstArray, int64_t count)
Copies the specified number of elements from the source array view to the destination array.
Definition: array.h:1162
Array(const std::array< UnderlyingType, InitArraySize > &init)
Constructs an Array object and fills it with values from the specified array containing elements of U...
Definition: array.h:449
size_t GetSizeTLength() const
Returns an std::size_t variable that represents the total number of all elements in all dimensions of...
Definition: array.h:868
int32_t get_Length() const override
Returns 32-bit integer that represents the total number of all elements in all dimensions of the arra...
Definition: array.h:848
static void Resize(ArrayPtr< Type > &arr, int new_size)
Changes the size of the specified array to the specified value or crates new array with specified siz...
Definition: array.h:1507
static void Copy(System::Details::StackArray< SrcType, N > &srcArray, const ArrayPtr< DstType > &dstArray, int64_t count)
Copies the specified number of elements from the source array on stack to the destination array.
Definition: array.h:1204
static void Copy(const ArrayPtr< SrcType > &srcArray, int64_t srcIndex, System::Details::ArrayView< DstType > dstArray, int64_t dstIndex, int64_t count)
Copies a specified number of elements from the source array starting at the specified index to the sp...
Definition: array.h:1278
const_iterator cend() const noexcept
Returns an iterator to the element following the last element of the container. This element acts as ...
Definition: array.h:1621
static int LastIndexOf(const ArrayPtr< ArrayType > &items, const ValueType &value)
Determines the index of the last occurrence of the specified item in the array.
Definition: array.h:1097
std::vector< UnderlyingType, typename pointer_mode_t::allocator_type > vector_t
An alias for the type used to store the array's elements.
Definition: array.h:302
int GetUpperBound(int dimension)
Returns the upper bound of the specified dimension.
Definition: array.h:727
void SetTemplateWeakPtr(uint32_t argument) override
Makes array treat stored pointers as weak (if applicable).
Definition: array.h:497
const_iterator begin() const noexcept
Returns an iterator to the first element of the const-qualified container. If the container is empty,...
Definition: array.h:1589
virtual void Insert(int, const T &) override
Not supported because array represented by the current object is read-only.
Definition: array.h:594
static void Copy(const ArrayPtr< SrcType > &srcArray, int64_t srcIndex, const ArrayPtr< DstType > &dstArray, int64_t dstIndex, int64_t count)
Copies a specified number of elements from the source array starting at the specified index to the sp...
Definition: array.h:1242
static void Copy(System::Details::ArrayView< SrcType > srcArray, int64_t srcIndex, const ArrayPtr< DstType > &dstArray, int64_t dstIndex, int64_t count)
Copies a specified number of elements from the source array view starting at the specified index to t...
Definition: array.h:1260
const_reverse_iterator crend() const noexcept
Returns a reverse iterator to the element following the last element of the reversed container....
Definition: array.h:1675
static void Sort(const ArrayPtr< Type > &arr, int startIndex, int count)
Sorts a range of elements in the specified array using default comparer.
Definition: array.h:1380
vector_t::const_iterator const_iterator
Const iterator type.
Definition: array.h:1572
pointer_mode_t m_pointer_mode
Information on whether to treat array elements as shared or weak pointers, if applicable.
Definition: array.h:304
Array(typename std::enable_if< std::is_arithmetic< T >::value &&std::is_arithmetic< ValueType >::value &&std::is_convertible< ValueType, T >::value, int >::type count, ValueType init)
Filling constructor.
Definition: array.h:401
reverse_iterator rend() noexcept
Returns a reverse iterator to the element following the last element of the reversed container....
Definition: array.h:1657
const_reverse_iterator rbegin() const noexcept
Returns a reverse iterator to the first element of the reversed container. It corresponds to the last...
Definition: array.h:1639
static void Reverse(const ArrayPtr< Type > &arr, int startIndex, int count)
Reverses a range of elements in the specified array.
Definition: array.h:1490
static void Copy(const ArrayPtr< SrcType > &srcArray, int64_t srcIndex, System::Details::StackArray< DstType, N > &dstArray, int64_t dstIndex, int64_t count)
Copies a specified number of elements from the source array starting at the specified index to the sp...
Definition: array.h:1329
Array()
Constructs an empty array.
Definition: array.h:389
Array(std::initializer_list< UnderlyingType > init)
Constructs an Array object and fills it with values from the specified initializer list containing el...
Definition: array.h:443
System::Details::VirtualizedIteratorBase< T > * virtualizeBeginIterator() override
Gets the implementation of begin iterator for the current container.
Definition: array.h:1722
int Count() const
Returns a number that represents the total number of all elements in all dimensions of the array.
Definition: array.h:875
UnderlyingType & operator[](int index)
Returns an item at the specified index.
Definition: array.h:645
Interface that compares two objects in greater-equal-less sense. Objects of this class should only be...
Definition: icomparer.h:21
Interface of enumerator which can be used to iterate through some elements. Objects of this class sho...
Definition: ienumerator.h:63
Interface of indexed container of elements. Objects of this class should only be allocated using Syst...
Definition: ilist.h:19
Represents a pointer to the method that compares two objects of the same type. This type should be al...
Definition: comparison.h:93
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:51
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
auto end() -> decltype(std::declval< Q >().end())
Accessor for end() method of an underling collection. Only compiles if SmartPtr_ is specialization ty...
Definition: smart_ptr.h:838
auto begin() -> decltype(std::declval< Q >().begin())
Accessor for begin() method of an underling collection. Only compiles if SmartPtr_ is specialization ...
Definition: smart_ptr.h:830
Object * GetObjectOrNull() const
Gets pointed object (if any) or nullptr. Same as get().
Definition: smart_ptr.h:783
int get_shared_count() const
Gets number of shared pointers existing to referenced object, including current one....
Definition: smart_ptr.h:803
Pointee_ * get_shared() const
Gets pointed object, but asserts that pointer is in shared mode.
Definition: smart_ptr.h:524
class System::SmartPtr::Data m_data
An instance of Data class.
int _net_binnary_search(const containterT< T, Allocator > &container, int index, int count, T value, const SharedPtr< System::Collections::Generic::IComparer< T > > &comparer)
Implements binary search in random access container.
Definition: algorithms.h:23
Definition: db_command.h:9
ArrayPtr< T > MakeArray(std::initializer_list< T > init)
A factory function that constructs a new Array object, fills it with the elements from the specified ...
Definition: array.h:164
MulticastDelegate< void(Args...)> Action
Delegate type that references methods that have no return value.
Definition: action.h:40
SmartPtr< X > MakeSharedPtr(X *p)
Converts raw pointer to smart pointer.
Definition: smart_ptr.h:1650
MulticastDelegate< TOutput(TInput)> Converter
Represents a pointer to the invokable entity that accepts a single argument of the TInput type and re...
Definition: converter.h:14
MulticastDelegate< bool(T)> Predicate
Represents a pointer to a predicate - an invokable entity that accepts a single argument and returns ...
Definition: predicate.h:41
typename MakeConstRef< T >::type MakeConstRef_t
Helper type for MakeConstRef modifier.
Definition: make_const_ref.h:20
System::ArrayPtr< uint8_t > ByteArrayPtr
An alias for a smart pointer object that points to an array of unsigned 8-bit integers.
Definition: array.h:133
class ASPOSECPP_SHARED_CLASS Array
Definition: smart_ptr.h:22
SmartPtr< TTo > type
An alias for a pointer to an instance of TTo.
Definition: object.h:376
Adapter to use IComparer within STL environment. Uses IComparer if set; otherwise,...
Definition: icomparer.h:45