Summary

An ArcGISCollection<T> represents a mutable collection of supported ArcGIS objects. It acts as a lightweight proxy to an underlying native collection and creates wrapper objects when elements are accessed.

The collection supports C++ range-based for loops through its begin() and end() functions. It is move-only: copy construction and copy assignment are deleted.

Explicit collection specializations are provided for:

Compatible derived types, such as specific layer types, can be passed to supported collection operations where applicable.

Constructors

ArcGISCollection<T>()

Creates an empty ArcGISCollection<T> for a supported element type.

Since 1.0.0

explicit ArcGISCollection<T>(void* handle)

Creates an ArcGISCollection<T> that references an existing native collection handle.

Since 1.0.0

Arguments
NameTypeConstSummary
handlevoid*No

The native collection handle.

ArcGISCollection<T>(ArcGISCollection<T>&& other)

Moves the native collection handle from another ArcGISCollection<T>.

The source collection is left in a valid but unspecified state.

Since 1.0.0

Arguments
NameTypeConstSummary
otherArcGISCollection<T>&&No

The collection to move.

Properties

PropertyTypeNullableReadonlySummary
Handlevoid*YesNo

The native collection handle.

Sizesize_tNoYes

The number of elements in the collection.

Handle

void* GetHandle() const

void SetHandle(void* handle)

The native collection handle.

Size

size_t GetSize() const

The number of elements in the collection.

Nested classes

NameSummary
ConstIterator

A read-only iterator over the collection.

Iterator

An iterator over the collection.

ConstIterator

A read-only iterator returned by the const overloads of Begin and End.

ConstIterator(const ArcGISCollection<T>* collection, size_t offset)

Creates a read-only iterator at the specified offset.

Arguments
NameTypeConstSummary
collectionconst ArcGISCollection<T>*Yes

The collection to iterate.

offsetsize_tNo

The initial zero-based offset.

ConstIterator& operator++()

Advances the iterator to the next element.

bool operator!=(const ConstIterator& rhs) const

Indicates whether two iterators refer to different positions or collections.

const T operator*() const

Returns the element at the current iterator position.

Iterator

An iterator returned by the non-const overloads of Begin and End.

Iterator(ArcGISCollection<T>* collection, size_t offset)

Creates an iterator at the specified offset.

Arguments
NameTypeConstSummary
collectionArcGISCollection<T>*No

The collection to iterate.

offsetsize_tNo

The initial zero-based offset.

Iterator& operator++()

Advances the iterator to the next element.

bool operator!=(const Iterator& rhs) const

Indicates whether two iterators refer to different positions or collections.

T operator*()

Returns the element at the current iterator position.

Methods

SignatureReturn TypeSummary

operator[](size_t)

T

Returns the element at the specified index.

Begin()

Iterator

Returns an iterator to the first element.

Begin() const

ConstIterator

Returns a read-only iterator to the first element.

End()

Iterator

Returns an iterator one position past the last element.

End() const

ConstIterator

Returns a read-only iterator one position past the last element.

operator bool() const noexcept

bool

Indicates whether the collection contains a valid native handle.

operator=(ArcGISCollection<T>&&)

ArcGISCollection<T>&

Move-assigns another collection to this collection.

Add(const T&)

size_t

Adds an element to the collection.

Add(const U&)

size_t

Adds a compatible element type to the collection.

AddArray(const ArcGISCollection<T>&)

size_t

Adds all elements from another collection.

At(size_t)

T

Returns the element at the specified position.

Contains(const T&)

bool

Indicates whether the collection contains the specified element.

Contains(const U&)

bool

Indicates whether the collection contains a compatible element type.

Equals(const ArcGISCollection<T>&)

bool

Indicates whether this collection is equal to another collection.

First()

T

Returns the first element.

IndexOf(const T&)

size_t

Returns the position of the specified element.

IndexOf(const U&)

size_t

Returns the position of a compatible element type.

Insert(size_t, const T&)

void

Inserts an element at the specified position.

Insert(size_t, const U&)

void

Inserts a compatible element type at the specified position.

IsEmpty()

bool

Indicates whether the collection contains no elements.

Last()

T

Returns the last element.

Move(size_t, size_t)

void

Moves an element from one position to another.

Npos()

size_t

Returns the value used to indicate that a position was not found.

Remove(size_t)

void

Removes the element at the specified position.

RemoveAll()

void

Removes all elements.

OperatorSubscript

T operator[](size_t index) const

Returns the element at the specified zero-based index.

Since 1.0.0

Arguments
NameTypeConstSummary
indexsize_tNo

The zero-based index of the element.

Returns T

The element at the specified index.

Begin

Iterator begin()

Returns an iterator to the first element in the collection.

Since 1.0.0

Returns Iterator

An iterator to the first element.

ConstIterator begin() const

Returns a read-only iterator to the first element in the collection.

Since 1.0.0

Returns ConstIterator

A read-only iterator to the first element.

End

Iterator end()

Returns an iterator one position past the last element in the collection.

Since 1.0.0

Returns Iterator

An iterator one position past the last element.

ConstIterator end() const

Returns a read-only iterator one position past the last element in the collection.

Since 1.0.0

Returns ConstIterator

A read-only iterator one position past the last element.

OperatorBool

operator bool() const noexcept

Indicates whether the collection contains a valid native handle.

Since 1.0.0

Returns bool

true if the native handle is not null; otherwise, false.

OperatorAssign

ArcGISCollection<T>& operator=(ArcGISCollection<T>&& other) noexcept

Move-assigns another collection to this collection.

Since 1.0.0

Arguments
NameTypeConstSummary
otherArcGISCollection<T>&&No

The collection to move.

Returns ArcGISCollection<T>&

A reference to this collection.

Add

size_t Add(const T& value)

Adds an element to the collection.

Since 1.0.0

Arguments
NameTypeConstSummary
valueTYes

The element to add.

Returns size_t

The position where the element was added.

template<typename U> size_t Add(const U& value)

Adds a compatible element type to the collection.

Since 1.0.0

Arguments
NameTypeConstSummary
valueUYes

The compatible element to add.

Returns size_t

The position where the element was added.

AddArray

size_t AddArray(const ArcGISCollection<T>& vector2)

Adds all elements from another collection to the end of this collection.

Since 1.0.0

Arguments
NameTypeConstSummary
vector2ArcGISCollection<T>Yes

The collection containing the elements to add.

Returns size_t

The position returned after the elements are added.

At

T At(size_t position) const

Returns the element at the specified position.

Since 1.0.0

Arguments
NameTypeConstSummary
positionsize_tNo

The zero-based position of the element.

Returns T

The element at the specified position.

Contains

bool Contains(const T& value) const

Indicates whether the collection contains the specified element.

Since 1.0.0

Arguments
NameTypeConstSummary
valueTYes

The element to find.

Returns bool

true if the collection contains the element; otherwise, false.

template<typename U> bool Contains(const U& value) const

Indicates whether the collection contains a compatible element type.

Since 1.0.0

Arguments
NameTypeConstSummary
valueUYes

The compatible element to find.

Returns bool

true if the collection contains the element; otherwise, false.

Equals

bool Equals(const ArcGISCollection<T>& vector2) const

Indicates whether this collection is equal to another collection.

Since 1.0.0

Arguments
NameTypeConstSummary
vector2ArcGISCollection<T>Yes

The collection to compare.

Returns bool

true if the collections are equal; otherwise, false.

First

T First() const

Returns the first element in the collection.

Since 1.0.0

Returns T

The first element in the collection.

IndexOf

size_t IndexOf(const T& value) const

Returns the position of the specified element.

Since 1.0.0

Arguments
NameTypeConstSummary
valueTYes

The element to find.

Returns size_t

The position of the element, or Npos if the element is not found.

template<typename U> size_t IndexOf(const U& value) const

Returns the position of a compatible element type.

Since 1.0.0

Arguments
NameTypeConstSummary
valueUYes

The compatible element to find.

Returns size_t

The position of the element, or Npos if the element is not found.

Insert

void Insert(size_t position, const T& value)

Inserts an element at the specified position.

Since 1.0.0

Arguments
NameTypeConstSummary
positionsize_tNo

The zero-based position where the element will be inserted.

valueTYes

The element to insert.

Returns void

This method does not return a value.

template<typename U> void Insert(size_t position, const U& value)

Inserts a compatible element type at the specified position.

Since 1.0.0

Arguments
NameTypeConstSummary
positionsize_tNo

The zero-based position where the element will be inserted.

valueUYes

The compatible element to insert.

Returns void

This method does not return a value.

IsEmpty

bool IsEmpty() const

Indicates whether the collection contains no elements.

Since 1.0.0

Returns bool

true if the collection is empty; otherwise, false.

Last

T Last() const

Returns the last element in the collection.

Since 1.0.0

Returns T

The last element in the collection.

Move

void Move(size_t oldPosition, size_t newPosition)

Moves an element from one position to another.

Since 1.0.0

Arguments
NameTypeConstSummary
oldPositionsize_tNo

The current zero-based position of the element.

newPositionsize_tNo

The new zero-based position of the element.

Returns void

This method does not return a value.

Npos

static size_t Npos()

Returns the value used to indicate that a position was not found.

Since 1.0.0

Returns size_t

The value representing an invalid or unavailable position.

Remove

void Remove(size_t position)

Removes the element at the specified position.

Since 1.0.0

Arguments
NameTypeConstSummary
positionsize_tNo

The zero-based position of the element to remove.

Returns void

This method does not return a value.

RemoveAll

void RemoveAll()

Removes all elements from the collection.

Since 1.0.0

Returns void

This method does not return a value.

Examples

The collection can be iterated using a C++ range-based for loop.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
Esri::Unreal::ArcGISCollection<Esri::GameEngine::Layers::Base::ArcGISLayer> layers;

layers.Add(imageLayer);

for (auto layer : layers)
{
    // Use the layer.
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.