Skip to main content

DPF C++ Client Library 2025 R2

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

Last update: 16.07.2025

Represents a modifiable vector of data and manages its memory. More...

#include <dpf_api_base.h>

Public Member Functions

 DpfVector (Client const *const for_object)
 
 DpfVector (Client const &for_object)
 
 DpfVector (iterator const &begin, iterator const &end)
 Creates a vector from a range of an other vector (range from begin to end). More...
 
 DpfVector (DpfVector const &)
 
 DpfVector (DpfVector &&) noexcept
 
DpfVectoroperator= (DpfVector const &)
 
DpfVectoroperator= (DpfVector &&) noexcept
 
T & operator[] (dp_index idx)
 
operator[] (dp_index idx) const
 
T const *const data () const
 
T *const data ()
 
dp_int size () const
 
bool defined () const
 
void commit () const
 
void copy (std::vector< T > &to_fill) const
 
std::vector< T > copy () const
 
iterator begin () const
 
iterator end () const
 
void reset (iterator const &begin, iterator const &end)
 Reinitialize the data with a range of an other vector (range from begin to end). More...
 

Detailed Description

template<typename T>
class ansys::dpf::DpfVector< T >

Represents a modifiable vector of data and manages its memory.

If the DpfVector is returned by a local entity, then it's a direct pointer to its data else if the DpfVector 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 is destructed.

Constructor & Destructor Documentation

◆ DpfVector()

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()

template<typename T >
void ansys::dpf::DpfVector< T >::commit

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

◆ defined()

template<typename T >
bool ansys::dpf::DpfVector< T >::defined ( ) const
inline

Return an true information if the DpfVector object has data set.

◆ reset()

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()

template<typename T >
dp_int ansys::dpf::DpfVector< T >::size ( ) const
inline

Return the size of the data contained in the DpfVector object.

Connect with Ansys