System::Collections::ObjectModel::Collection class

Collection class

通用集合的基类型。此类的对象只能使用 System::MakeObject() 函数分配。切勿在栈上或使用 new 运算符创建此类型的实例,因为这会导致运行时错误和/或断言失败。始终将此类包装到 System::SmartPtr 指针中,并使用该指针将其作为参数传递给函数。

template<class T>class Collection : public System::Collections::Generic::IList<T>
参数描述
T元素类型。

Nested classes

方法

方法描述
Add(const T&) override向容器添加值。
Clear() override删除所有元素。
Collection()创建空集合。
Collection(SharedPtr<Generic::IList<T>>)
Contains(const T&) const override检查集合中是否存在该项。
CopyTo(ArrayPtr<T>, int) override将集合元素复制到现有数组元素中。
crbegin() const获取指向集合中最后一个 const 限定元素的逆向迭代器(逆向的第一个)。
crend() const获取指向集合起始之前的不存在的 const 限定元素的逆向迭代器。
get_Count() const override获取元素数量。
get_Items()内部数据结构访问器。
get_Items() const内部数据结构访问器。
GetEnumerator() override获取用于遍历集合的枚举器。
idx_get(int) const override获取指定索引处的值。
idx_set(int, T) override在指定索引处设置值。
IndexOf(const T&) const override在集合中查找元素。
Insert(int, const T&) override在指定位置插入项目。
operator[](int)获取指定索引处的值。
operator[](int) const获取指定索引处的值。
rbegin()获取指向集合中最后一个元素的逆向迭代器(逆向的第一个)。
rbegin() const获取指向 const 限定集合中最后一个元素的逆向迭代器(逆向的第一个)。
Remove(const T&) override移除特定项。
RemoveAt(int) override在特定位置移除项目。
rend()获取指向集合起始之前的不存在的元素的逆向迭代器。
rend() const获取指向 const 限定集合起始之前的不存在的元素的逆向迭代器。
SetTemplateWeakPtr(uint32_t) override将存储的指针设为弱引用(如果适用)。
virtualizeBeginConstIterator() const override获取当前容器的 begin const 迭代器的实现。
virtualizeBeginIterator() override获取当前容器的 begin 迭代器的实现。
virtualizeEndConstIterator() const override获取当前容器的 end const 迭代器的实现。
virtualizeEndIterator() override获取当前容器的 end 迭代器的实现。

Typedefs

类型定义描述
const_reverse_iterator
reverse_iterator

另见