Skip to main content

DPF Cpp Client Library 2026 R1

Class ansys::dpf::Collection

Last update: 25.03.2026

Contains a group of entries of same type. The AnyCollection is designed as a set of entries ordered through labels and ids. Labels identify how the entries are filtered.

See also: Any

Template parameters:

  • typename DataT

Inherits from:

  • ansys::dpf::CollectionBase

Members

Friends

Public functions

Function Collection

ansys::dpf::Collection< DataT >::Collection()

Return type:

Function ~Collection

virtual ansys::dpf::Collection< DataT >::~Collection()=default

Return type:

Function Collection

ansys::dpf::Collection< DataT >::Collection(Collection< DataT > const &)

Parameters:

  • rhsCollection< DataT > const &

Return type:

Function Collection

ansys::dpf::Collection< DataT >::Collection(Collection< DataT > &&) noexcept

Parameters:

  • rhsCollection< DataT > &&

Return type:

Function Collection

ansys::dpf::Collection< DataT >::Collection(std::vector< std::string > const &labels)

Create container for a group of entries with the given labels.

Parameters:

  • std::vector< std::string > const & labels: [in] Labels for group of entries.

Return type:

Function Collection

ansys::dpf::Collection< DataT >::Collection(Client const *const client)

Create a new collection on a server.

Parameters:

  • Client const *const client: [in] Client instance designating the IP, port and protocol to use.

Return type:

Function Collection

ansys::dpf::Collection< DataT >::Collection(Client const *const client, std::vector< std::string > const &labels)

Create a collection with the given labels on a server.

Parameters:

  • Client const *const client: [in] Client instance designating the IP, port and protocol to use.
  • std::vector< std::string > const & labels: [in] Labels for meshes.

Return type:

Function Collection

ansys::dpf::Collection< DataT >::Collection(int id, Client const *const client)

Retrieve an existing instance of Collection on a server.

Parameters:

  • int id: [in] Id of the Collection object on the server's database.
  • Client const *const client: [in] Client instance designating the IP, port and protocol to use.

Return type:

Function operator=

Collection< DataT > & ansys::dpf::Collection< DataT >::operator=(Collection< DataT > const &)

Parameters:

  • rhsCollection< DataT > const &

Return type: Collection &

Function operator=

Collection< DataT > & ansys::dpf::Collection< DataT >::operator=(Collection< DataT > &&) noexcept

Parameters:

  • rhsCollection< DataT > &&

Return type: Collection &

Function operator[]

DataT ansys::dpf::Collection< DataT >::operator[](dp_int index)

Returns:

Any for given index.

Parameters:

  • dp_int index: [in] Index of entries within container.

Return type: DataT

Function at

DataT ansys::dpf::Collection< DataT >::at(dp_index index)

Returns:

DataT for given index.

Parameters:

Return type: DataT

Function at

const DataT ansys::dpf::Collection< DataT >::at(dp_index index) const

Returns:

DataT for given index.

Parameters:

Return type: const DataT

Function update

void ansys::dpf::Collection< DataT >::update(DataT &f, dp_index index)

Update a Any at index.

Parameters:

  • DataT & f: [in] New Any.
  • dp_index index: [in] Index of Any to update.

Return type: void

Function add

void ansys::dpf::Collection< DataT >::add(LabelSpace const &labels, DataT const &f, bool can_replace=true)

Add Any with given label space.

Parameters:

  • LabelSpace const & labels: [in] Label space for Any.
  • DataT const & f: [in] Any to add.
  • bool can_replace = true : [in] if can_replace is false, then, the entity is pushed back without checking if the label space already exists, available starting with 2024R2.

Return type: void

Function getEntries

std::vector< DataT > ansys::dpf::Collection< DataT >::getEntries(LabelSpace const &label_space) const

Returns:

Vector of entries for given label space.

Parameters:

  • LabelSpace const & label_space: [in] Label space for which to get entries.

Return type: std::vector< DataT >

Function getEntry

DataT ansys::dpf::Collection< DataT >::getEntry(LabelSpace const &label_space) const

Returns:

First Any for given label space.

Parameters:

Return type: DataT

Function getEntriesIndices

std::vector< dp_index > ansys::dpf::Collection< DataT >::getEntriesIndices(LabelSpace const &lab_space) const

Parameters:

Return type: std::vector< dp_index >

Function getMatchingEntitiesIndices

DpfVector< int > ansys::dpf::Collection< DataT >::getMatchingEntitiesIndices(LabelSpace const &label_space) const

Returns:

Vector of matching entries to the given label space.

Parameters:

  • LabelSpace const & label_space: [in] Label space for which to get entries.

Return type: DpfVector< dp_index >

Function getMatchingEntity

DataT ansys::dpf::Collection< DataT >::getMatchingEntity(LabelSpace const &label_space) const

Returns:

First matching Any for given label space.

Parameters:

Return type: DataT

Function createSubCollection

Collection< DataT > ansys::dpf::Collection< DataT >::createSubCollection(LabelSpace const &lab_space) const

create a Collection with all the entries corresponding to the label space in input

Parameters:

Return type: Collection< DataT >

Public static functions

Function emptyCollection

Collection< DataT > ansys::dpf::Collection< DataT >::emptyCollection()

Create an empty container. Returns:

Empty container.

Return type: Collection< DataT >

Connect with Ansys