Skip To Content ArcGIS for Developers Sign In Dashboard

UtilityNetwork Class

(Esri::ArcGISRuntime::UtilityNetwork)

A utility network. More...

Header: #include <UtilityNetwork>
Since: Esri::ArcGISRuntime 100.6
Inherits: Object, Loadable, and RemoteResource

Public Functions

UtilityNetwork(const QUrl &url, QObject *parent = nullptr)
UtilityNetwork(const QUrl &url, Credential *credential, QObject *parent = nullptr)
UtilityNetwork(const QUrl &url, Map *map, QObject *parent = nullptr)
UtilityNetwork(const QUrl &url, Map *map, Credential *credential, QObject *parent = nullptr)
~UtilityNetwork()
UtilityElement *createElementWithArcGISFeature(ArcGISFeature *arcGISFeature, UtilityTerminal *terminal = nullptr, QObject *parent = nullptr)
UtilityElement *createElementWithAssetType(UtilityAssetType *assetType, const QUuid &globalId, UtilityTerminal *terminal = nullptr, QObject *parent = nullptr)
UtilityNetworkDefinition *definition() const
TaskWatcher featuresForElements(const QList<UtilityElement *> &elements)
ArcGISFeatureListModel *featuresForElementsResult() const
TaskWatcher trace(UtilityTraceParameters *traceParameters)
UtilityTraceResultListModel *traceResult() const

Reimplemented Public Functions

virtual void cancelLoad()
virtual Credential *credential() const
virtual void load()
virtual Error loadError() const
virtual LoadStatus loadStatus() const
virtual RequestConfiguration requestConfiguration() const
virtual void retryLoad()
virtual void setRequestConfiguration(const RequestConfiguration &requestConfiguration)
virtual QUrl url() const

Signals

void doneLoading(Esri::ArcGISRuntime::Error loadError)
void featuresForElementsCompleted(QUuid taskId)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
void traceCompleted(QUuid taskId)

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

A utility network.

This is the central class for ArcGIS utility network schema information and tracing.

UtilityNetwork follows the Loadable pattern. When it loads, it is populated with the utility network schema. This class provides methods to create UtilityElement objects for the UtilityNetwork.

See also Loadable.

Member Function Documentation

UtilityNetwork::UtilityNetwork(const QUrl &url, QObject *parent = nullptr)

Constructor that accepts a URL of the utility network feature service.

  • url - The URL of the utility network feature service.
  • parent - The parent object for this UtilityNetwork (optional)

UtilityNetwork::UtilityNetwork(const QUrl &url, Credential *credential, QObject *parent = nullptr)

Constructor that accepts a URL of the utility network feature service and a credential.

  • url - The URL of the utility network feature service
  • credential - The Credential used to access the service
  • parent - The parent object for this UtilityNetwork (optional)

UtilityNetwork::UtilityNetwork(const QUrl &url, Map *map, QObject *parent = nullptr)

Constructor that accepts a URL of the utility network feature service and a Map.

  • url - The URL of the utility network feature service
  • map - A Map that provides FeatureTables to be reused by the utility network
  • parent - The parent object for this UtilityNetwork (optional)

This constructor is used when creating a UtilityNetwork object from a web map. It creates a utility network associated with a particular service, using the same ArcGISFeatureTable objects in use by FeatureLayer objects within the map. This lets any UtilityElement or ArcGISFeature objects the UtilityNetwork creates or uses be associated with those existing tables and layers.

UtilityNetwork::UtilityNetwork(const QUrl &url, Map *map, Credential *credential, QObject *parent = nullptr)

Constructor that accepts a URL, a Map, and a Credential.

  • url - The URL of the utility network feature service
  • map - A Map that provides FeatureTables to be reused by the utility network
  • credential - The Credential used to access the service
  • parent - The parent object for this UtilityNetwork (optional)

This constructor is used when creating a UtilityNetwork object from a web map and a credential is needed. It creates a utility network associated with a particular service, using the same ArcGISFeatureTable objects in use by FeatureLayer objects within the map. This lets any UtilityElement or ArcGISFeature objects the UtilityNetwork creates or uses be associated with those existing tables and layers.

UtilityNetwork::~UtilityNetwork()

Destructor.

[virtual] void UtilityNetwork::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

UtilityElement *UtilityNetwork::createElementWithArcGISFeature(ArcGISFeature *arcGISFeature, UtilityTerminal *terminal = nullptr, QObject *parent = nullptr)

Creates a UtilityElement from an ArcGISFeature and an optional UtilityTerminal.

If a UtilityTerminal is not supplied, and if the feature's UtilityAssetType supports a UtilityTerminalConfiguration, a default UtilityTerminal will be assigned.

UtilityElement *UtilityNetwork::createElementWithAssetType(UtilityAssetType *assetType, const QUuid &globalId, UtilityTerminal *terminal = nullptr, QObject *parent = nullptr)

Creates a UtilityElement from a UtilityAssetType, a global ID of a feature, and an optional UtilityTerminal.

  • assetType - The UtilityAssetType of the feature from which this feature element is created
  • globalId - The GlobalID of the feature from which this feature element is created
  • terminal - The UtilityTerminal (optional).
  • parent - The parent object of the returned UtilityElement (optional).

If a UtilityTerminal is not supplied, and if the feature's UtilityAssetType supports a UtilityTerminalConfiguration, a default UtilityTerminal will be assigned.

[virtual] Credential *UtilityNetwork::credential() const

Reimplemented from RemoteResource::credential().

Returns the security credential used to access the utility network.

Note: Only applicable if using an online service that is secured.

UtilityNetworkDefinition *UtilityNetwork::definition() const

Returns the definition of the utility network.

The definition contains metadata about the associated utility network feature service.

[signal] void UtilityNetwork::doneLoading(Esri::ArcGISRuntime::Error loadError)

Signal emitted when this object is done loading.

  • loadError - The Error object.

Note: If there is a load error it will also be emitted on the errorOccurred signal.

See also Loadable and Object.

TaskWatcher UtilityNetwork::featuresForElements(const QList<UtilityElement *> &elements)

Creates a list of LoadStatus::Loaded ArcGISFeature objects where each object in the list corresponds to an item in the list of UtilityElement objects

The returned UtilityElement objects each have the UtilityNetwork object as their parent.

See also Returned QObjects Parenting.

[signal] void UtilityNetwork::featuresForElementsCompleted(QUuid taskId)

Signal emitted after any of the featuresForElements asynchronous tasks completes.

  • taskId - The task ID of the completed asynchronous task

ArcGISFeatureListModel *UtilityNetwork::featuresForElementsResult() const

Returns the list model of features that is the result of the featuresForElements task

The result list model will contain loaded ArcGISFeature objects corresponding to the collection of UtilityElement objects used in the task.

[virtual] void UtilityNetwork::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error UtilityNetwork::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

[virtual] LoadStatus UtilityNetwork::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

[signal] void UtilityNetwork::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Signal emitted when the load status changes for this object.

See also Loadable.

[virtual] RequestConfiguration UtilityNetwork::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this task.

See also setRequestConfiguration().

[virtual] void UtilityNetwork::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

[virtual] void UtilityNetwork::setRequestConfiguration(const RequestConfiguration &requestConfiguration)

Reimplemented from RemoteResource::setRequestConfiguration().

Sets the configuration parameters used for network requests sent by this task to requestConfiguration.

See also requestConfiguration().

TaskWatcher UtilityNetwork::trace(UtilityTraceParameters *traceParameters)

Begins a trace using the supplied trace parameters.

Returns a task that runs a trace and returns a list of UtilityTraceResult objects when the trace finishes.

[signal] void UtilityNetwork::traceCompleted(QUuid taskId)

Signal emitted after a trace asynchronous task completes.

  • taskId - The task ID of the asynchronous task

UtilityTraceResultListModel *UtilityNetwork::traceResult() const

Returns the list model of UtilityTraceResult.

See also trace.

[virtual] QUrl UtilityNetwork::url() const

Reimplemented from RemoteResource::url().

Returns the URL to the feature service utility network that was specified in the constructor.


Feedback on this topic?