System::Collections::ObjectModel::ReadOnlyCollection class

ReadOnlyCollection class

Wraps specific container to access it in read-only mode. 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.

template<typename T>class ReadOnlyCollection : public virtual System::Object,
                                               public System::Collections::Generic::IList<T>
ParameterDescription
TElement type.

Methods

MethodDescription
Contains(const T&) const overrideChecks if container contains specific item.
CopyTo(System::ArrayPtr<T>, int) overrideCopies container elements to existing array elements.
get_Count() const overrideGets count of container elements.
get_IsReadOnly() const overrideChecks if collection is read only.
GetEnumerator() overrideGets collection enumerator.
idx_get(int) const overrideGets item at specific position.
IndexOf(const T&) const overrideLooks for specific item in collection.
ReadOnlyCollection(const SharedPtr<Generic::IList<T>>&)Wraps read-only collection around specific collection.
SetTemplateWeakPtr(uint32_t) overrideDoes nothing as read-only collection only wraps data and stores nothing.
virtualizeBeginConstIterator() const overrideGets the implementation of begin const iterator for the current container.
virtualizeBeginIterator() overrideGets the implementation of begin iterator for the current container.
virtualizeEndConstIterator() const overrideGets the implementation of end const iterator for the current container.
virtualizeEndIterator() overrideGets the implementation of end iterator for the current container.

Typedefs

TypedefDescription
BaseTypeImplemented interface.
IEnumeratorPtrContainer of same elements.
ValueTypeValue type.

See Also