# CostAttribute Class

An attribute used to measure and model impedance on the network, such as travel time (transit time on a street). More...

Header: | #include <CostAttribute> |

Since: | Esri::ArcGISRuntime 100.0 |

This class was introduced in Esri::ArcGISRuntime 100.0.

## Public Functions

CostAttribute(Esri::ArcGISRuntime::CostAttribute &&other) | |

CostAttribute(const Esri::ArcGISRuntime::CostAttribute &other) | |

CostAttribute() | |

Esri::ArcGISRuntime::CostAttribute & | operator=(Esri::ArcGISRuntime::CostAttribute &&other) |

Esri::ArcGISRuntime::CostAttribute & | operator=(const Esri::ArcGISRuntime::CostAttribute &other) |

~CostAttribute() | |

Esri::ArcGISRuntime::AttributeUnit | attributeUnit() const |

bool | isEmpty() const |

QVariantMap | parameterValues() const |

## Detailed Description

Network analysis often involves the minimization of a cost (also known as impedance) during the calculation of a path (also known as finding the best route). Common examples include finding the fastest route (minimizing travel time) or the shortest route (minimizing distance).

Cost attributes are a property of the underlying network dataset. These attributes are apportionable along an edge; that is, they are divided proportionately along the length of an edge. For example, if travel time is modeled as a cost attribute, traversing half an edge will take half the time as does traversing the whole edge: if the travel time to traverse the edge is 3 minutes, it takes 1.5 minutes to traverse half the edge.

## Member Function Documentation

### CostAttribute::CostAttribute(Esri::ArcGISRuntime::CostAttribute &&*other*)

Move constructor from *other* CostAttribute.

### CostAttribute::CostAttribute(const Esri::ArcGISRuntime::CostAttribute &*other*)

Copy constructor from *other* CostAttribute.

### CostAttribute::CostAttribute()

Default constructor.

**Warning:** This is for convenience only and will construct an empty object.

### Esri::ArcGISRuntime::CostAttribute &CostAttribute::operator=(Esri::ArcGISRuntime::CostAttribute &&*other*)

Move operator from *other* CostAttribute.

### Esri::ArcGISRuntime::CostAttribute &CostAttribute::operator=(const Esri::ArcGISRuntime::CostAttribute &*other*)

Assignment operator from *other* CostAttribute.

### CostAttribute::~CostAttribute()

Destructor.

### Esri::ArcGISRuntime::AttributeUnit CostAttribute::attributeUnit() const

Returns the cost AttributeUnit used.

### bool CostAttribute::isEmpty() const

Returns `true`

if this CostAttribute is empty.

### QVariantMap CostAttribute::parameterValues() const

Returns key/value pairs representing the cost parameters.