A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-iterable.html below:

Iterable Class | ArcGIS Maps SDK for Qt

Detailed Description

Any class that inherits Iterable will support C++11 range-for loops as well as anything else that works with forward iterators.

Iterable types implement std::forward_iterator_tag functionality.

The purpose of this class is to allow certain C++11 and newer features to work with exising classes in the API. For example, you can iterate over the map's layers:

for (auto* layer : *(map->operationalLayers()))
{
  ...
}

In addition to the C++11 range-based for looping, you can also use std::for_each. For example:

QStringList layerNames;
std::for_each(operationalLayers->cbegin(), operationalLayers->cend(), [&layerNames](Layer* layer)
{ // gather all the names of the layers
  layerNames.append(layer->name());
});

Another example is searching for a layer with a specific name:

auto* opLayers = scene->operationalLayers();
auto it = std::find_if(opLayers->constBegin(), opLayers->constEnd(), [](Layer* l)
{
  return l->name() == "MyLayer";
});

if (it == opLayers->constEnd())
  return; // no match

// we found a match
Layer* match = *it;

Iterable also works with value objects. For example, you can iterate over the points in an ImmutablePointCollection:

const ImmutablePointCollection points = getPoints();
for (const Point& p : points)
{
  // do stuff with the points...
}
Member Function Documentation Iterable::Iterable()

Default constructor.

[virtual] Iterable::~Iterable()

Destructor.

[noexcept] Esri::ArcGISRuntime::Iterable<T>::iterator Iterable::begin()

Returns a non-const iterator to the first element of the collection.

[noexcept] Esri::ArcGISRuntime::Iterable<T>::const_iterator Iterable::begin() const

Returns a const iterator to the first element of the collection.

See also constBegin and cbegin.

[noexcept] Esri::ArcGISRuntime::Iterable<T>::const_iterator Iterable::cbegin() const

Returns a const iterator to the first element of the collection.

See also constBegin.

[noexcept] Esri::ArcGISRuntime::Iterable<T>::const_iterator Iterable::cend() const

Returns a const iterator one past the last element in the collection.

The cend iterator should not be dereferenced as it does not point to a valid object.

See also constEnd.

[noexcept] Esri::ArcGISRuntime::Iterable<T>::const_iterator Iterable::constBegin() const

Returns a const iterator to the first element of the collection.

See also cbegin.

[noexcept] Esri::ArcGISRuntime::Iterable<T>::const_iterator Iterable::constEnd() const

Returns a const iterator one past the last element in the collection.

The constEnd iterator should not be dereferenced as it does not point to a valid object.

See also cend.

[noexcept] Esri::ArcGISRuntime::Iterable<T>::iterator Iterable::end()

Returns a non-const iterator one past the last element in the collection.

The end iterator should not be dereferenced as it does not point to a valid object.

[noexcept] Esri::ArcGISRuntime::Iterable<T>::const_iterator Iterable::end() const

Returns a const iterator one past the last element in the collection.

The end iterator should not be dereferenced as it does not point to a valid object.

See also constEnd and cend.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4