> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ansys::dpf::DpfVector< T > Class Template Reference

Represents a modifiable vector of data and manages its memory.

`#include <dpf_api_base.h>`

## Public Member Functions

| Type | Name |
| - | - |
| | **DpfVector** ([Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) const \*const for\_object) |
| | **DpfVector** ([Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) const \&for\_object) |
| | [DpfVector](#a670674aaab714a8c63c62976b9be90b3) (iterator const \&begin, iterator const \&end) Creates a vector from a range of an other vector (range from begin to end). |
| | **DpfVector** ([DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) const &) |
| | **DpfVector** ([DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) &&) noexcept |
| [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) & | **operator=** ([DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) const &) |
| [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) & | **operator=** ([DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) &&) noexcept |
|  T & | **operator\[]** ([dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/namespaceansys_1_1dpf#a417548d1b705a9ba54ba9429afe68920) idx) |
|  T | **operator\[]** ([dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/namespaceansys_1_1dpf#a417548d1b705a9ba54ba9429afe68920) idx) const |
|  T const \*const | **data** () const |
|  T \*const | **data** () |
| [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) | [size](#acb74f526bb5e61fef09605354966ff16) () const |
| bool | [defined](#a0e5b28ad59e3352941d64e760b688f91) () const |
| void | [commit](#a2cc9e64a9e622ee766a5766c2faf85d4) () const |
|  void | **copy** (std::vector\< T > \&to\_fill) const |
|  std::vector\< T > | **copy** () const |
|  iterator | **begin** () const |
|  iterator | **end** () const |
| void | [reset](#ad6a4b21b02e43e7e139f59f00b184bbc) (iterator const \&begin, iterator const \&end) Reinitialize the data with a range of an other vector (range from begin to end). |

## Detailed Description

template\<typename T>\
&#x20;class ansys::dpf::DpfVector\< T >

Represents a modifiable vector of data and manages its memory.

If the [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) is returned by a local entity, then it's a direct pointer to its data else if the [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) is returned by a remote entity, then it's a copy of the data and the remote data is updated (if necessary) when the [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) is destructed.

## Constructor & Destructor Documentation

### DpfVector()

```cpp theme={null}
template<typename T >
ansys::dpf::DpfVector < T >:: DpfVector(
    iterator const & begin,
    iterator const & end
)
```

Creates a vector from a range of an other vector (range from begin to end).

Copyless constructor: the new vector is created with a reference on the same data as begin and end: modifying the new vector data, will also modify the initial vector.

## Member Function Documentation

### commit()

```cpp theme={null}
template<typename T >
void ansys::dpf::DpfVector < T >::commit
```

Update the data in the object (if the vector is pointing on remote data).

### defined()

```cpp theme={null}
template<typename T >
bool ansys::dpf::DpfVector < T >::defined() const
```

`inline`

Return an true information if the [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) object has data set.

### reset()

```cpp theme={null}
template<typename T >
void ansys::dpf::DpfVector < T >::reset(
    iterator const & begin,
    iterator const & end
)
```

`inline`

Reinitialize the data with a range of an other vector (range from begin to end).

Copyless: the new data is created with a reference on the same data as begin and end: modifying the new vector data, will also modify the initial vector.

### size()

```cpp theme={null}
template<typename T >
dp_int ansys::dpf::DpfVector < T >::size() const
```

`inline`

Return the size of the data contained in the [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfVector.md) object.
