Asposecpplib

Class that represents an array data structure. Objects of this class should only be allocated using System::MakeArray() and System::MakeObject() functions. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...

Inherits System::Object, and System::Collections::Generic::IList< T >.

Classes

class  Enumerator
 Implements IEnumerator interface that enables enumeration of elements of an Array object. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 

Public Types

using ValueType = T
 Alias for the type of the elements of the array. More...
 
using UnderlyingType = typename System::Details::SelectType< T >::type
 Alias for the type used to represent each element of the array. More...
 
typedef SharedPtr< Collections::Generic::IEnumerable< T > > EnumerablePtr
 An alias for shared pointer type pointing to IEnumerable object containing elements of type T. More...
 
typedef SharedPtr< Collections::Generic::IEnumerator< T > > EnumeratorPtr
 An alias for shared pointer type pointing to IEnumerator object containing elements of type T. More...
 
- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 
- Public Types inherited from System::Collections::Generic::IList< T >
typedef ICollection< T > BaseType
 Base type. More...
 
typedef IList< T > ThisType
 This type. More...
 
typedef T ValueType
 Value type. More...
 
- Public Types inherited from System::Collections::Generic::ICollection< T >
typedef T ValueType
 Value type name. More...
 
typedef ICollection< T > ThisType
 Collection type name. More...
 
- Public Types inherited from System::Collections::Generic::IEnumerable< T >
typedef IEnumerator< T > IEnumeratorType
 Enumerator type. More...
 

Public Member Functions

 Array ()
 Constructs an empty array. More...
 
 Array (int count, const T &init=T())
 Filling constructor. More...
 
template<typename ValueType >
 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. More...
 
 Array (int count, const T inits[])
 Filling constructor. More...
 
 Array (vector_t &&value)
 Move constructor. More...
 
 Array (const vector_t &assgn)
 Copy constructor. More...
 
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>
 Array (const std::vector< Q > &value)
 Constructs an Array object and fills it with values copied from an std::vector object whose values' type is the same as T but different from UnderlyingType. More...
 
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>
 Array (std::vector< Q > &&value)
 Constructs an Array object and fills it with values moved from an std::vector object whose values' type is the same as T but different from UnderlyingType. More...
 
 Array (std::initializer_list< UnderlyingType > init)
 Constructs an Array object and fills it with values from the specified initializer list containing elements of UnderlyingType type. More...
 
 Array (std::initializer_list< bool > init, int=0)
 Constructs an Array object and fills it with values from the specified initializer list containing elements of bool type. More...
 
virtual EnumeratorPtr GetEnumerator () override
 Returns a pointer to Enumerator object that provides IEnumerator interface to elements of the array represented by the current object. More...
 
virtual int get_Count () const override
 Returns the size of the array. More...
 
virtual void Add (const T &) override
 Not supported because the array represented by the current object is read-only. More...
 
virtual void Clear () override
 Not supported because the array represented by the current object is read-only. More...
 
void SetTemplateWeakPtr (unsigned int argument) override
 Makes array treat stored pointers as weak (if applicable). More...
 
virtual bool Contains (const T &item) const override
 Determines if the specified item is in the array. More...
 
virtual bool Remove (const T &) override
 Not supported because the array represented by the current object is read-only. More...
 
virtual bool get_IsReadOnly () const override
 Indicates whether the array is read-only. More...
 
virtual void CopyTo (ArrayPtr< T > arr, int arrayIndex) override
 Copies all elements of the current array to the specefied destination array. Elements are insterted into destination array starting at index specified by arrayIndex argument. More...
 
virtual int IndexOf (const T &item) const override
 Determines the inedex of the first occurrence of the specified item in the array. More...
 
virtual void Insert (int, const T &) override
 Not supported because array represented by the current object is read-only. More...
 
virtual void RemoveAt (int) override
 Not supported because array represented by the current object is read-only. More...
 
virtual T idx_get (int index) const override
 Returns the item at the specified index. More...
 
virtual void idx_set (int index, T value) override
 Sets the specified value as the item of the array at the specified index. More...
 
ArrayPtr< T > Init (const T inits[])
 Fills the array represented by the current object with the values from the specified array. More...
 
void Initialize ()
 Fills the array with the default constructed objects of type T. More...
 
UnderlyingTypeoperator[] (int index)
 Returns an item at the specified index. More...
 
UnderlyingType const & operator[] (int index) const
 Returns an item at the specified index. More...
 
ArrayPtr< T > Clone ()
 Clones the array. More...
 
int GetLength (int dimension)
 Returns the number of elements in the specified dimension. More...
 
int64_t GetLongLength (int dimension)
 Returns the number of elements in the specified dimension as 64-bit integer. More...
 
int GetLowerBound (int dimension) const
 Returns the lower bound of the specified dimension. More...
 
int GetUpperBound (int dimension)
 Returns the upper bound of the specified dimension. More...
 
int32_t get_Rank () const
 NOT IMPLEMENTED. More...
 
int32_t get_Length () const
 Returns 32-bit integer that represents the total number of all elements in all dimensions of the array. More...
 
int64_t get_LongLength () const
 Returns 64-bit integer that represents the total number of all elements in all dimensions of the array. More...
 
size_t GetSizeTLength () const
 Returns an std::size_t variable that represents the total number of all elements in all dimensions of the array. More...
 
int Count () const
 Returns a number that represents the total number of all elements in all dimensions of the array. More...
 
template<typename DstType >
void CopyTo (const ArrayPtr< DstType > &dstArray, int64_t dstIndex) const
 Copies all elements of the current array to the specefied destination array. Elements are insterted into the destination array starting at index specified by dstIndex argument. More...
 
template<typename DstType >
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 specefied destination array. Elements are insterted into the destination array starting at index specified by dstIndex argument. More...
 
void SetValue (const T &value, int index)
 Sets value of the element at specified index. More...
 
vector_t & data ()
 Returns a reference to the internal data structure used to store the array elements. More...
 
const vector_t & data () const
 Returns a constant reference to the internal data structure used to store the array elements. More...
 
vector_t::pointer data_ptr ()
 Returns a raw pointer to the beginning of the memory buffer where the array elements are stored. More...
 
const UnderlyingTypedata_ptr () const
 Returns a constant raw pointer to the beginning of the memory buffer where the array elements are stored. More...
 
vector_t::iterator begin () noexcept
 Returns an iterator to the first element of the container. If the container is empty, the returned iterator will be equal to end(). More...
 
vector_t::const_iterator begin () const noexcept
 Returns an iterator to the first element of the container. If the container is empty, the returned iterator will be equal to end(). More...
 
vector_t::const_iterator cbegin () const noexcept
 Returns an iterator to the first element of the container. If the container is empty, the returned iterator will be equal to cend(). More...
 
vector_t::iterator end () noexcept
 Returns an iterator to the element following the last element of the container. This element acts as a placeholder; attempting to access it results in undefined behavior. More...
 
vector_t::const_iterator end () const noexcept
 Returns an iterator to the element following the last element of the container. This element acts as a placeholder; attempting to access it results in undefined behavior. More...
 
vector_t::const_iterator cend () const noexcept
 Returns an iterator to the element following the last element of the container. This element acts as a placeholder; attempting to access it results in undefined behavior. More...
 
vector_t::reverse_iterator rbegin () noexcept
 Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to rend(). More...
 
vector_t::const_reverse_iterator rbegin () const noexcept
 Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to rend(). More...
 
vector_t::const_reverse_iterator crbegin () const noexcept
 Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to crend(). More...
 
vector_t::reverse_iterator rend () noexcept
 Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior. More...
 
vector_t::const_reverse_iterator rend () const noexcept
 Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior. More...
 
vector_t::const_reverse_iterator crend () const noexcept
 Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior. More...
 
SharedPtr< Objectget_SyncRoot ()
 Gets object to use for locking if making array operation thread-safe. More...
 
UnderlyingType Min () const
 Finds the smallest element in the array using operator<() to compare elements. More...
 
UnderlyingType Max () const
 Finds the largest element in the array using operator<() to compare elements. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 
- Public Member Functions inherited from System::Collections::Generic::ICollection< T >
ICollectionoperator= (ICollection &&)
 Move assignment operator. More...
 
ICollectionoperator= (const ICollection &)
 Move assignment operator. More...
 
 ICollection ()
 Default constructor. More...
 
 ICollection (const ICollection &)
 Copy constructor. More...
 
 ICollection (ICollection &&)
 Move constructor. More...
 
virtual ~ICollection ()
 Destructor. More...
 

Static Public Member Functions

static int BinarySearch (System::ArrayPtr< T > arr, const T &item)
 Performs binary search in the sorted array. More...
 
template<typename InputType , typename OutputType >
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 OutputType type using the specified converter delegate. More...
 
template<typename InputType , typename OutputType >
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 OutputType type using the specified converter function object. More...
 
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 predicate. More...
 
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 predicate. More...
 
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. More...
 
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 predicate. More...
 
static void ForEach (const ArrayPtr< T > &arr, System::Action< T > action)
 Performs specified action on each element of the specified array. More...
 
template<typename ArrayType , typename ValueType >
static int IndexOf (const ArrayPtr< ArrayType > &arr, const ValueType &value)
 Determines the index of the first occurence of specified item in the array. More...
 
template<typename ArrayType , typename ValueType >
static int IndexOf (const ArrayPtr< ArrayType > &arr, const ValueType &value, int startIndex)
 Determines the index of the first occurence of the specified item in the array startig from the specified index. More...
 
template<typename ArrayType , typename ValueType >
static int IndexOf (const ArrayPtr< ArrayType > &arr, const ValueType &value, int startIndex, int count)
 Determines the index of the first occurence of the specified item in a range of items of the array specified by the start index and the number of elements in the range. More...
 
template<typename ArrayType , typename ValueType >
static int LastIndexOf (const ArrayPtr< ArrayType > &arr, const ValueType &value, int startIndex, int count)
 Determines the index of the last occurence of the specified item in a range of items of the array specified by the start index and the number of elements in the range. More...
 
template<typename ArrayType , typename ValueType >
static int LastIndexOf (const ArrayPtr< ArrayType > &items, const ValueType &value, int startIndex)
 Determines the index of the last occurence of the specified item in the array startig from the specified index. More...
 
template<typename ArrayType , typename ValueType >
static int LastIndexOf (const ArrayPtr< ArrayType > &items, const ValueType &value)
 Determines the index of the last occurence of the specified item in the array. More...
 
template<typename Type >
static void Clear (ArrayPtr< Type > &arr, int startIndex, int count)
 Replaces count values starting at startIndex intedx in the specified array with default values. More...
 
template<typename SrcType , typename DstType >
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. More...
 
template<typename SrcType , typename DstType >
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 specified position in destination array. More...
 
template<typename Type >
static void Sort (ArrayPtr< Type > &arr)
 Sorts elements in the specified array using default comparer. More...
 
template<typename Type >
static void Sort (ArrayPtr< Type > &arr, int startIndex, int count)
 Sorts a range of elements in the specified array using default comparer. More...
 
template<typename Type >
static void Sort (ArrayPtr< Type > &arr, const SharedPtr< System::Collections::Generic::IComparer< T >> &comparator)
 Sorts elements in the specified array using specified comparer. More...
 
template<typename TKey , typename TValue >
static void Sort (ArrayPtr< TKey > &keys, ArrayPtr< TValue > &items)
 Sorts two arrays one containing keys and the other - corresponding items, based on the values of array contaninig keys, elements of which are compared using operator<. More...
 
template<typename TKey , typename TValue >
static void Sort (ArrayPtr< TKey > &keys, ArrayPtr< TValue > &items, int index, int length)
 Sorts two arrays one containing keys and the other - corresponding items, based on the values of array contaninig keys, elements of which are compared using default comparer. More...
 
template<typename Type >
static void Reverse (ArrayPtr< Type > &arr)
 Reverses elements in the specified array. More...
 
template<typename Type >
static void Reverse (ArrayPtr< Type > &arr, int startIndex, int count)
 Reverses a range of elements in the specified array. More...
 
template<typename Type >
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 size. More...
 
static bool Exists (ArrayPtr< T > arr, std::function< bool(T)> match)
 Determines if the specified Array object contains an element that satisfies reqierements of the specified predicate. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Detailed Description

template<typename T>
class System::Array< T >

Class that represents an array data structure. Objects of this class should only be allocated using System::MakeArray() and System::MakeObject() functions. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

Template Parameters
TType of elements of an array

Member Typedef Documentation

◆ EnumerablePtr

An alias for shared pointer type pointing to IEnumerable object containing elements of type T.

◆ EnumeratorPtr

An alias for shared pointer type pointing to IEnumerator object containing elements of type T.

◆ UnderlyingType

template<typename T>
using System::Array< T >::UnderlyingType = typename System::Details::SelectType<T>::type

Alias for the type used to represent each element of the array.

◆ ValueType

template<typename T>
using System::Array< T >::ValueType = T

Alias for the type of the elements of the array.

Constructor & Destructor Documentation

◆ Array() [1/10]

template<typename T>
System::Array< T >::Array ( )
inline

Constructs an empty array.

◆ Array() [2/10]

template<typename T>
System::Array< T >::Array ( int  count,
const T &  init = T() 
)
inline

Filling constructor.

Parameters
countInitial size of the array
initThe initial value used to fill the array with

◆ Array() [3/10]

template<typename T>
template<typename ValueType >
System::Array< T >::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 
)
inline

Filling constructor.

Parameters
countInitial size of the array
initThe initial value used to fill the array with
Template Parameters
ValueTypeType of initial value

◆ Array() [4/10]

template<typename T>
System::Array< T >::Array ( int  count,
const T  inits[] 
)
inline

Filling constructor.

Parameters
countInitial size of the array
initsValues to fill the array with

◆ Array() [5/10]

template<typename T>
System::Array< T >::Array ( vector_t &&  value)
inline

Move constructor.

Parameters
valuestd::vector, elements of which are acquired by the array

◆ Array() [6/10]

template<typename T>
System::Array< T >::Array ( const vector_t &  assgn)
inline

Copy constructor.

Parameters
assgnstd::vector to copy values from

◆ Array() [7/10]

template<typename T>
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>
System::Array< T >::Array ( const std::vector< Q > &  value)
inline

Constructs an Array object and fills it with values copied from an std::vector object whose values' type is the same as T but different from UnderlyingType.

Parameters
valuestd::vector to copy the values from
Template Parameters
QThe type of the elements of the std::vector object to copy the elements from

◆ Array() [8/10]

template<typename T>
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>
System::Array< T >::Array ( std::vector< Q > &&  value)
inline

Constructs an Array object and fills it with values moved from an std::vector object whose values' type is the same as T but different from UnderlyingType.

Parameters
valuestd::vector to copy the values from
Template Parameters
QThe type of the elements of the std::vector object to move the elements from

◆ Array() [9/10]

template<typename T>
System::Array< T >::Array ( std::initializer_list< UnderlyingType init)
inline

Constructs an Array object and fills it with values from the specified initializer list containing elements of UnderlyingType type.

Parameters
initInitializer list containing elements to fill the array with

◆ Array() [10/10]

template<typename T>
System::Array< T >::Array ( std::initializer_list< bool >  init,
int  = 0 
)
inline

Constructs an Array object and fills it with values from the specified initializer list containing elements of bool type.

Parameters
initInitializer list containing elements to fill the array with

Member Function Documentation

◆ Add()

template<typename T>
virtual void System::Array< T >::Add ( const T &  )
inlineoverridevirtual

Not supported because the array represented by the current object is read-only.

Exceptions
NotSupportedExceptionalways

Implements System::Collections::Generic::ICollection< T >.

◆ begin() [1/2]

template<typename T>
vector_t::iterator System::Array< T >::begin ( )
inlinenoexcept

Returns an iterator to the first element of the container. If the container is empty, the returned iterator will be equal to end().

◆ begin() [2/2]

template<typename T>
vector_t::const_iterator System::Array< T >::begin ( ) const
inlinenoexcept

Returns an iterator to the first element of the container. If the container is empty, the returned iterator will be equal to end().

◆ BinarySearch()

template<typename T>
static int System::Array< T >::BinarySearch ( System::ArrayPtr< T >  arr,
const T &  item 
)
inlinestatic

Performs binary search in the sorted array.

Parameters
arrSorted array to perform search in
itemAn item to search for
Returns
Index of the searched item if one is found, otherwise, a negative integer that is the bitwise complement of the index of the next item greater than searched item or, if there is no greater item, the bitwise complement of the number of elements in the array.

◆ cbegin()

template<typename T>
vector_t::const_iterator System::Array< T >::cbegin ( ) const
inlinenoexcept

Returns an iterator to the first element of the container. If the container is empty, the returned iterator will be equal to cend().

◆ cend()

template<typename T>
vector_t::const_iterator System::Array< T >::cend ( ) const
inlinenoexcept

Returns an iterator to the element following the last element of the container. This element acts as a placeholder; attempting to access it results in undefined behavior.

◆ Clear() [1/2]

template<typename T>
virtual void System::Array< T >::Clear ( )
inlineoverridevirtual

Not supported because the array represented by the current object is read-only.

Exceptions
NotSupportedExceptionalways

Implements System::Collections::Generic::ICollection< T >.

◆ Clear() [2/2]

template<typename T>
template<typename Type >
static void System::Array< T >::Clear ( ArrayPtr< Type > &  arr,
int  startIndex,
int  count 
)
inlinestatic

Replaces count values starting at startIndex intedx in the specified array with default values.

Parameters
arrTarget array
startIndexIndex at which to start replacing the items
countThe number of items to replace
Template Parameters
TypeType of elements in the target array

◆ Clone()

template<typename T>
ArrayPtr<T> System::Array< T >::Clone ( )
inline

Clones the array.

Returns
A pointer to a new array object containing items that are copies of items of the array reprsented by the current object.

◆ Contains()

template<typename T>
virtual bool System::Array< T >::Contains ( const T &  item) const
inlineoverridevirtual

Determines if the specified item is in the array.

Parameters
itemItem to look for in the array
Returns
true if the specified item is present in the array, false otherwise

Implements System::Collections::Generic::ICollection< T >.

◆ ConvertAll() [1/2]

template<typename T>
template<typename InputType , typename OutputType >
static ArrayPtr<OutputType> System::Array< T >::ConvertAll ( ArrayPtr< InputType >  input_array,
Converter< InputType, OutputType >  converter 
)
inlinestatic

Constructs a new Array object and fills it with elements of the specified array converted to OutputType type using the specified converter delegate.

Parameters
input_arrayAn Array object
converterA Converter object used to convert each element of the input array to equvalent values of OutputType type
Returns
A new array containing values of OutputType type equivalent to the values of input_array
Template Parameters
InputTypeThe type of elements of input array
OutputTypeThe type of elements of the resulting array

◆ ConvertAll() [2/2]

template<typename T>
template<typename InputType , typename OutputType >
static ArrayPtr<OutputType> System::Array< T >::ConvertAll ( ArrayPtr< InputType >  input_array,
std::function< OutputType(InputType)>  converter 
)
inlinestatic

Constructs a new Array object and fills it with elements of the specified array converted to OutputType type using the specified converter function object.

Parameters
input_arrayAn Array object
converterA function object used to convert each element of the input array to equvalent values of OutputType type
Returns
A new array containing values of OutputType type equivalent to the values of input_array
Template Parameters
InputTypeThe type of elements of input array
OutputTypeThe type of elements of the resulting array

◆ Copy() [1/2]

template<typename T>
template<typename SrcType , typename DstType >
static void System::Array< T >::Copy ( const ArrayPtr< SrcType > &  srcArray,
const ArrayPtr< DstType > &  dstArray,
int64_t  count 
)
inlinestatic

Copies the specified number of elements from the source array to the destination array.

Parameters
srcArraySource array
dstArrayDestination array
countThe number of elements to copy

◆ Copy() [2/2]

template<typename T>
template<typename SrcType , typename DstType >
static void System::Array< T >::Copy ( const ArrayPtr< SrcType > &  srcArray,
int64_t  srcIndex,
const ArrayPtr< DstType > &  dstArray,
int64_t  dstIndex,
int64_t  count 
)
inlinestatic

Copies a specified number of elements from the source array starting at the specified index to the specified position in destination array.

Parameters
srcArraySource array
srcIndexIndex in the source array designating the beginning of the range of items to copy
dstArrayDestination array
dstIndexIndex in destination array to start inserting copied items at
countThe number of elements to copy
Template Parameters
SrcTypeType of elements in source array
DstTypeType of elements in destination array

◆ CopyTo() [1/3]

template<typename T>
virtual void System::Array< T >::CopyTo ( ArrayPtr< T >  arr,
int  arrayIndex 
)
inlineoverridevirtual

Copies all elements of the current array to the specefied destination array. Elements are insterted into destination array starting at index specified by arrayIndex argument.

Parameters
arrDestination array
arrayIndexIndex in destination array to start inserting copied items at

Implements System::Collections::Generic::ICollection< T >.

◆ CopyTo() [2/3]

template<typename T>
template<typename DstType >
void System::Array< T >::CopyTo ( const ArrayPtr< DstType > &  dstArray,
int64_t  dstIndex 
) const
inline

Copies all elements of the current array to the specefied destination array. Elements are insterted into the destination array starting at index specified by dstIndex argument.

Parameters
dstArrayDestination array
dstIndexIndex in destination array to start inserting copied items at
Template Parameters
DstTypeType of elements in destination array

◆ CopyTo() [3/3]

template<typename T>
template<typename DstType >
void System::Array< T >::CopyTo ( const ArrayPtr< DstType > &  dstArray,
int64_t  srcIndex,
int64_t  dstIndex,
int64_t  count 
) const
inline

Copies a specified number of elements from the current array starting at specified position to specefied destination array. Elements are insterted into the destination array starting at index specified by dstIndex argument.

Parameters
dstArrayDestination array
srcIndexIndex in source array to start copying items at
dstIndexIndex in destination array to start inserting copied items at
countNumber of elements to copy
Template Parameters
DstTypeType of elements in destination array

◆ Count()

template<typename T>
int System::Array< T >::Count ( ) const
inline

Returns a number that represents the total number of all elements in all dimensions of the array.

Returns
Total number of all elements in all dimensions

◆ crbegin()

template<typename T>
vector_t::const_reverse_iterator System::Array< T >::crbegin ( ) const
inlinenoexcept

Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to crend().

◆ crend()

template<typename T>
vector_t::const_reverse_iterator System::Array< T >::crend ( ) const
inlinenoexcept

Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior.

◆ data() [1/2]

template<typename T>
vector_t& System::Array< T >::data ( )
inline

Returns a reference to the internal data structure used to store the array elements.

◆ data() [2/2]

template<typename T>
const vector_t& System::Array< T >::data ( ) const
inline

Returns a constant reference to the internal data structure used to store the array elements.

◆ data_ptr() [1/2]

template<typename T>
vector_t::pointer System::Array< T >::data_ptr ( )
inline

Returns a raw pointer to the beginning of the memory buffer where the array elements are stored.

◆ data_ptr() [2/2]

template<typename T>
const UnderlyingType* System::Array< T >::data_ptr ( ) const
inline

Returns a constant raw pointer to the beginning of the memory buffer where the array elements are stored.

◆ end() [1/2]

template<typename T>
vector_t::iterator System::Array< T >::end ( )
inlinenoexcept

Returns an iterator to the element following the last element of the container. This element acts as a placeholder; attempting to access it results in undefined behavior.

◆ end() [2/2]

template<typename T>
vector_t::const_iterator System::Array< T >::end ( ) const
inlinenoexcept

Returns an iterator to the element following the last element of the container. This element acts as a placeholder; attempting to access it results in undefined behavior.

◆ Exists()

template<typename T>
static bool System::Array< T >::Exists ( ArrayPtr< T >  arr,
std::function< bool(T)>  match 
)
inlinestatic

Determines if the specified Array object contains an element that satisfies reqierements of the specified predicate.

Parameters
arrThe array to look for the element in
matchFunction object that defines requirements and checks if an element satisfies them
Returns
True if arr contains an element that satisfies requirements defined by match

◆ Find()

template<typename T>
static T System::Array< T >::Find ( System::ArrayPtr< T >  arr,
System::Predicate< T >  match 
)
inlinestatic

Searches for the first element in the specified array that satisfies the conditions of the specified predicate.

Parameters
arrArray to search an element in
matchA predicate that defines the conditions to match array elements against
Returns
Copy of the first element in the array that satisfies the conditions defined by predicate, otherwise default value of type T

◆ FindAll()

template<typename T>
static System::ArrayPtr<T> System::Array< T >::FindAll ( System::ArrayPtr< T >  arr,
System::Predicate< T >  match 
)
inlinestatic

Retrieves all the elements that match the conditions defined by the specified predicate.

Parameters
arrArray to search an elements in
matchA predicate that defines the conditions to match array elements against
Returns
An Array containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty Array.

◆ FindIndex()

template<typename T>
static int System::Array< T >::FindIndex ( System::ArrayPtr< T >  arr,
System::Predicate< T >  match 
)
inlinestatic

Searches for the first element in the specified array that satisfies the conditions of the specified predicate.

Parameters
arrArray to search an element in
matchA predicate that defines the conditions to match array elements against
Returns
The index of the first element in the array that sitisfies the conditions defined by pradicate, otherwise -1

◆ ForEach()

template<typename T>
static void System::Array< T >::ForEach ( const ArrayPtr< T > &  arr,
System::Action< T >  action 
)
inlinestatic

Performs specified action on each element of the specified array.

Parameters
arrTarget array
actionThe action to perform on each element of the array

◆ get_Count()

template<typename T>
virtual int System::Array< T >::get_Count ( ) const
inlineoverridevirtual

Returns the size of the array.

Implements System::Collections::Generic::ICollection< T >.

◆ get_IsReadOnly()

template<typename T>
virtual bool System::Array< T >::get_IsReadOnly ( ) const
inlineoverridevirtual

Indicates whether the array is read-only.

Returns
true if the array is read-only, false otherwise.

Reimplemented from System::Collections::Generic::ICollection< T >.

◆ get_Length()

template<typename T>
int32_t System::Array< T >::get_Length ( ) const
inline

Returns 32-bit integer that represents the total number of all elements in all dimensions of the array.

Returns
Total number of all elements in all dimensions

◆ get_LongLength()

template<typename T>
int64_t System::Array< T >::get_LongLength ( ) const
inline

Returns 64-bit integer that represents the total number of all elements in all dimensions of the array.

Returns
Total number of all elements in all dimensions

◆ get_Rank()

template<typename T>
int32_t System::Array< T >::get_Rank ( ) const
inline

NOT IMPLEMENTED.

◆ get_SyncRoot()

template<typename T>
SharedPtr<Object> System::Array< T >::get_SyncRoot ( )
inline

Gets object to use for locking if making array operation thread-safe.

◆ GetEnumerator()

template<typename T>
virtual EnumeratorPtr System::Array< T >::GetEnumerator ( )
inlineoverridevirtual

Returns a pointer to Enumerator object that provides IEnumerator interface to elements of the array represented by the current object.

Returns
Pointer to Enumerator object

Implements System::Collections::Generic::IEnumerable< T >.

◆ GetLength()

template<typename T>
int System::Array< T >::GetLength ( int  dimension)
inline

Returns the number of elements in the specified dimension.

Parameters
dimensionA dimension the length of which to return
Returns
Number of elements in the specified dimension

◆ GetLongLength()

template<typename T>
int64_t System::Array< T >::GetLongLength ( int  dimension)
inline

Returns the number of elements in the specified dimension as 64-bit integer.

Parameters
dimensionA dimension the length of which to return
Returns
A 64-bit integer representing the number of elements in specified dimension

◆ GetLowerBound()

template<typename T>
int System::Array< T >::GetLowerBound ( int  dimension) const
inline

Returns the lower bound of the specified dimension.

Parameters
dimensionDimension to return the lower bound of
Returns
The lower bound of the specified dimension

◆ GetSizeTLength()

template<typename T>
size_t System::Array< T >::GetSizeTLength ( ) const
inline

Returns an std::size_t variable that represents the total number of all elements in all dimensions of the array.

Returns
Total number of all elements in all dimensions

◆ GetUpperBound()

template<typename T>
int System::Array< T >::GetUpperBound ( int  dimension)
inline

Returns the upper bound of the specified dimension.

Parameters
dimensionDimension to return the upper bound of
Returns
The upper bound of the specified dimension

◆ idx_get()

template<typename T>
virtual T System::Array< T >::idx_get ( int  index) const
inlineoverridevirtual

Returns the item at the specified index.

Parameters
indexIndex of the item to be returned
Returns
The item at specified index in the array

Implements System::Collections::Generic::IList< T >.

◆ idx_set()

template<typename T>
virtual void System::Array< T >::idx_set ( int  index,
value 
)
inlineoverridevirtual

Sets the specified value as the item of the array at the specified index.

Parameters
indexIndex to set value at
valueValue to set at specified index

Implements System::Collections::Generic::IList< T >.

◆ IndexOf() [1/4]

template<typename T>
virtual int System::Array< T >::IndexOf ( const T &  item) const
inlineoverridevirtual

Determines the inedex of the first occurrence of the specified item in the array.

Parameters
itemItem index of which is to be determined
Returns
Index of the first occurrence of the specified item if the item is found, otherwise -1

Implements System::Collections::Generic::IList< T >.

◆ IndexOf() [2/4]

template<typename T>
template<typename ArrayType , typename ValueType >
static int System::Array< T >::IndexOf ( const ArrayPtr< ArrayType > &  arr,
const ValueType value 
)
inlinestatic

Determines the index of the first occurence of specified item in the array.

Parameters
arrArray to search the specified item in
valueItem index of which is to be determined
Returns
Index of the first occurence specified item if the item is found, otherwise -1
Template Parameters
ArrayTypeType of elements in the target array
ValueTypetype of the item to search for in the array

◆ IndexOf() [3/4]

template<typename T>
template<typename ArrayType , typename ValueType >
static int System::Array< T >::IndexOf ( const ArrayPtr< ArrayType > &  arr,
const ValueType value,
int  startIndex 
)
inlinestatic

Determines the index of the first occurence of the specified item in the array startig from the specified index.

Parameters
arrArray to search the specified item in
valueItem index of which is to be determined
startIndexIndex at which the search is started
Returns
Index of the first occurence of the specified item if the item is found, otherwise -1
Template Parameters
ArrayTypeType of elements in the target array
ValueTypetype of the item to search for in the array

◆ IndexOf() [4/4]

template<typename T>
template<typename ArrayType , typename ValueType >
static int System::Array< T >::IndexOf ( const ArrayPtr< ArrayType > &  arr,
const ValueType value,
int  startIndex,
int  count 
)
inlinestatic

Determines the index of the first occurence of the specified item in a range of items of the array specified by the start index and the number of elements in the range.

Parameters
arrArray to search the specified item in
valueItem index of which is to be determined
startIndexIndex at which the search is started
countNumber of elements of the range to search in
Returns
Index of the first occurence of the specified item if the item is found, otherwise -1
Template Parameters
ArrayTypeType of elements in the target array
ValueTypetype of the item to search for in the array

◆ Init()

template<typename T>
ArrayPtr<T> System::Array< T >::Init ( const T  inits[])
inline

Fills the array represented by the current object with the values from the specified array.

Parameters
initsThe array to copy the values from
Returns
A shared pointer pointing to the current object

◆ Initialize()

template<typename T>
void System::Array< T >::Initialize ( )
inline

Fills the array with the default constructed objects of type T.

◆ Insert()

template<typename T>
virtual void System::Array< T >::Insert ( int  ,
const T &   
)
inlineoverridevirtual

Not supported because array represented by the current object is read-only.

Exceptions
NotSupportedExceptionalways

Implements System::Collections::Generic::IList< T >.

◆ LastIndexOf() [1/3]

template<typename T>
template<typename ArrayType , typename ValueType >
static int System::Array< T >::LastIndexOf ( const ArrayPtr< ArrayType > &  arr,
const ValueType value,
int  startIndex,
int  count 
)
inlinestatic

Determines the index of the last occurence of the specified item in a range of items of the array specified by the start index and the number of elements in the range.

Parameters
arrArray to search the specified item in
valueItem index of which is to be determined
startIndexIndex at which the search is started
countNumber of elements of the range to search in
Returns
Index of the last occurence of the specified item if the item is found, otherwise -1
Template Parameters
ArrayTypeType of elements in the target array
ValueTypetype of the item to search for in the array

◆ LastIndexOf() [2/3]

template<typename T>
template<typename ArrayType , typename ValueType >
static int System::Array< T >::LastIndexOf ( const ArrayPtr< ArrayType > &  items,
const ValueType value,
int  startIndex 
)
inlinestatic

Determines the index of the last occurence of the specified item in the array startig from the specified index.

Parameters
itemsArray to search the specified item in
valueItem index of which is to be determined
startIndexIndex at which the search is started
Returns
Index of the last occurence of the specified item if the item is found, otherwise -1
Template Parameters
ArrayTypeType of elements in the target array
ValueTypetype of the item to search for in the array

◆ LastIndexOf() [3/3]

template<typename T>
template<typename ArrayType , typename ValueType >
static int System::Array< T >::LastIndexOf ( const ArrayPtr< ArrayType > &  items,
const ValueType value 
)
inlinestatic

Determines the index of the last occurence of the specified item in the array.

Parameters
itemsArray to search the specified item in
valueItem index of which is to be determined
Returns
Index of the last occurence of the specified item if the item is found, otherwise -1
Template Parameters
ArrayTypeType of elements in the target array
ValueTypetype of the item to search for in the array

◆ Max()

template<typename T>
UnderlyingType System::Array< T >::Max ( ) const
inline

Finds the largest element in the array using operator<() to compare elements.

Returns
A copy of the largest element in the array.

◆ Min()

template<typename T>
UnderlyingType System::Array< T >::Min ( ) const
inline

Finds the smallest element in the array using operator<() to compare elements.

Returns
A copy of the smallest element in the array.

◆ operator[]() [1/2]

template<typename T>
UnderlyingType& System::Array< T >::operator[] ( int  index)
inline

Returns an item at the specified index.

Parameters
indexIndex of the item to return
Returns
A reference to an item at specified position

◆ operator[]() [2/2]

template<typename T>
UnderlyingType const& System::Array< T >::operator[] ( int  index) const
inline

Returns an item at the specified index.

Parameters
indexIndex of the item to return
Returns
A const reference to an item at the specified position

◆ rbegin() [1/2]

template<typename T>
vector_t::reverse_iterator System::Array< T >::rbegin ( )
inlinenoexcept

Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to rend().

◆ rbegin() [2/2]

template<typename T>
vector_t::const_reverse_iterator System::Array< T >::rbegin ( ) const
inlinenoexcept

Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to rend().

◆ Remove()

template<typename T>
virtual bool System::Array< T >::Remove ( const T &  )
inlineoverridevirtual

Not supported because the array represented by the current object is read-only.

Exceptions
NotSupportedExceptionalways

Implements System::Collections::Generic::ICollection< T >.

◆ RemoveAt()

template<typename T>
virtual void System::Array< T >::RemoveAt ( int  )
inlineoverridevirtual

Not supported because array represented by the current object is read-only.

Exceptions
NotSupportedExceptionalways

Implements System::Collections::Generic::IList< T >.

◆ rend() [1/2]

template<typename T>
vector_t::reverse_iterator System::Array< T >::rend ( )
inlinenoexcept

Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior.

◆ rend() [2/2]

template<typename T>
vector_t::const_reverse_iterator System::Array< T >::rend ( ) const
inlinenoexcept

Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior.

◆ Resize()

template<typename T>
template<typename Type >
static void System::Array< T >::Resize ( ArrayPtr< Type > &  arr,
int  new_size 
)
inlinestatic

Changes the size of the specified array to the specified value or crates new array with specified size.

Parameters
arrArray to resize. If arr is null-pointer, the new array will be created
new_sizeThe new size of the array, or the size of the new array of arr is null

◆ Reverse() [1/2]

template<typename T>
template<typename Type >
static void System::Array< T >::Reverse ( ArrayPtr< Type > &  arr)
inlinestatic

Reverses elements in the specified array.

Parameters
arrTarget array

◆ Reverse() [2/2]

template<typename T>
template<typename Type >
static void System::Array< T >::Reverse ( ArrayPtr< Type > &  arr,
int  startIndex,
int  count 
)
inlinestatic

Reverses a range of elements in the specified array.

Parameters
arrTarget array
startIndexIndex in the array at which the range to reverse start
countThe size of the range to reverse

◆ SetTemplateWeakPtr()

template<typename T>
void System::Array< T >::SetTemplateWeakPtr ( unsigned int  argument)
inlineoverridevirtual

Makes array treat stored pointers as weak (if applicable).

Parameters
argumentShould be 0 as there is only one template argument present.

Reimplemented from System::Object.

◆ SetValue()

template<typename T>
void System::Array< T >::SetValue ( const T &  value,
int  index 
)
inline

Sets value of the element at specified index.

Parameters
valueA onst reference to the value to set
indexIndex of the element

◆ Sort() [1/5]

template<typename T>
template<typename Type >
static void System::Array< T >::Sort ( ArrayPtr< Type > &  arr)
inlinestatic

Sorts elements in the specified array using default comparer.

Parameters
arrTarged array

◆ Sort() [2/5]

template<typename T>
template<typename Type >
static void System::Array< T >::Sort ( ArrayPtr< Type > &  arr,
int  startIndex,
int  count 
)
inlinestatic

Sorts a range of elements in the specified array using default comparer.

Parameters
arrTarged array
startIndexThe index designating the beginning of the range of elements to sort
countThe size of the range of elements to sort

◆ Sort() [3/5]

template<typename T>
template<typename Type >
static void System::Array< T >::Sort ( ArrayPtr< Type > &  arr,
const SharedPtr< System::Collections::Generic::IComparer< T >> &  comparator 
)
inlinestatic

Sorts elements in the specified array using specified comparer.

Parameters
arrTarged array
comparatorIComparer<T> object used to compare elements of the array

◆ Sort() [4/5]

template<typename T>
template<typename TKey , typename TValue >
static void System::Array< T >::Sort ( ArrayPtr< TKey > &  keys,
ArrayPtr< TValue > &  items 
)
inlinestatic

Sorts two arrays one containing keys and the other - corresponding items, based on the values of array contaninig keys, elements of which are compared using operator<.

Parameters
keysArray that contains key values
itemsArray that contains items that are mapped to the key values in keys array
Template Parameters
TKeyThe type of the elements in the keys array
TValuethe type of the elements in the items array

◆ Sort() [5/5]

template<typename T>
template<typename TKey , typename TValue >
static void System::Array< T >::Sort ( ArrayPtr< TKey > &  keys,
ArrayPtr< TValue > &  items,
int  index,
int  length 
)
inlinestatic

Sorts two arrays one containing keys and the other - corresponding items, based on the values of array contaninig keys, elements of which are compared using default comparer.

Parameters
keysArray that contains key values
itemsArray that contains items that are mapped to the key values in keys array
indexThe index designating the beginnig of the range to sort
lengthThe number of elements in the range to sort
Template Parameters
TKeyThe type of the elements in the keys array
TValuethe type of the elements in the items array

◆ TrueForAll()

template<typename T>
static bool System::Array< T >::TrueForAll ( System::ArrayPtr< T >  arr,
System::Predicate< T >  match 
)
inlinestatic

Determines whether all elements in the specified array satisfy the conditions defined by specified predicate.

Parameters
arrArray elements of which to match against the conditions
matchA predicate that defines the conditions to match array elements against
Returns
true if all elements of the array arr satisfy the conditions defined by predicate match, otherwise false