> ## 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.

# Class ansys::dpf::CollectionBase

![][C++]
![][public]

**Inherits from**:

* [ansys::dpf::DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md)

**Inherited by**:

* [ansys::dpf::Collection\< DataT >](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-collection.md)
* [ansys::dpf::CustomTypeFieldsContainer](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-customtypefieldscontainer.md)
* [ansys::dpf::FieldsContainer](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-fieldscontainer.md)
* [ansys::dpf::MeshesContainer](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-meshescontainer.md)
* [ansys::dpf::ScopingsContainer](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-scopingscontainer.md)

## Members

* [addLabel](#classansys-dpf-collectionbase-1a623a0b168512a4621fb7af8084f9872b)
* [addLabel](#classansys-dpf-collectionbase-1ac6ce7bc876d6a94a97996d5febba5116)
* [addLabels](#classansys-dpf-collectionbase-1ae97480559c14c59e830559582c1f2cd5)
* [callAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aea34d37e0c080126eff70db34bf46597)
* [describe](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a9977945710983bc03d2940fa007847b2)
* [empty](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a39cd546c42518e2332be8f287db95459)
* [getClient](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a968afd9daa0b0f13b65a2ac61369d73a)
* [getLabelSpace](#classansys-dpf-collectionbase-1a66d62492d07889a95a5d10f9d827cd11)
* [getSizeFor](#classansys-dpf-collectionbase-1aab65999d65acb4eab6aa7375266e5456)
* [hasBeenMovedLocally](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a1a5634202c15404b6b24e8f50e51cb66)
* [hasInternalObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ae198f89868d85c7db6dc1a934a1d3c15)
* [hasLabel](#classansys-dpf-collectionbase-1a82ac9433fd3963b37b07989ef05de331)
* [id](#classansys-dpf-collectionbase-1a5e8d2dd8b9b6cf273985ce3ead392830)
* [isOnCommonAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a9f9789ff61cc9d400a2a344830706b73)
* [isSameObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aa64d5f8fcd7d85ad6ebf708494dbefd7)
* [labels](#classansys-dpf-collectionbase-1a2c1bb3718e1a96d3f40b64794eb25f91)
* [labelScoping](#classansys-dpf-collectionbase-1ac61aef82ffe249c95dd10cf40de7c910)
* [name](#classansys-dpf-collectionbase-1a691450ab7c89db80f39d6bb2d10eace4)
* [reserve](#classansys-dpf-collectionbase-1a98ab98c9a6b91b886fd600ed7d9e633b)
* [resize](#classansys-dpf-collectionbase-1ac88664d3e1d22abb74a95c8223b1e771)
* [setId](#classansys-dpf-collectionbase-1a93ebbfe9396dd1c4f447e799db6cbf3b)
* [setName](#classansys-dpf-collectionbase-1a44394f964c6130dcbaed446cec3b0197)
* [setSupport](#classansys-dpf-collectionbase-1ae6f7683496d153ed944856d42b97dc82)
* [setSupport](#classansys-dpf-collectionbase-1ada2a037068417557fd7d410577a7fbb9)
* [size](#classansys-dpf-collectionbase-1a69e6878d2d691807f8a45ddfbda42f9e)
* [support](#classansys-dpf-collectionbase-1a9830a03b992af391bf03acad90eac372)
* [\~CollectionBase](#classansys-dpf-collectionbase-1a99e04439d35f26b89f4d66813d74035b)
* [\~DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ab7c83b6ea160c2b115e056f6c312112f)

## Friends

### Friend internal::set\_prop

![][C++]
![][public]

## Public functions

### Function \~CollectionBase

![][public]

```cpp theme={null}
virtual ansys::dpf::CollectionBase::~CollectionBase()=default
```

**Return type**:

### Function size

![][public]
![][const]

```cpp theme={null}
dp_int ansys::dpf::CollectionBase::size() const
```

Get Number of entries in container.
**Returns**:

Number of entries.

**Return type**: [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0)

### Function reserve

![][public]

```cpp theme={null}
void ansys::dpf::CollectionBase::reserve(dp_int size)
```

Reserve space for entries

**Parameters**:

* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **size**: \[in] Number of entries for which to reserve space.

**Return type**: void

### Function resize

![][public]

```cpp theme={null}
void ansys::dpf::CollectionBase::resize(dp_int size)
```

Resize container to given size.

**Parameters**:

* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **size**: \[in] Set container to number of entries.

**Return type**: void

### Function addLabel

![][public]

```cpp theme={null}
void ansys::dpf::CollectionBase::addLabel(std::string const &label)
```

Add new label to field.

**Parameters**:

* std::string const & **label**: \[in] New label.

**Return type**: void

### Function addLabel

![][public]

```cpp theme={null}
void ansys::dpf::CollectionBase::addLabel(std::string const &label, dp_id default_value)
```

Add new label with value.

**Parameters**:

* std::string const & **label**: \[in] New label.
* [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e) **default\_value**: \[in] Value of label.

**Return type**: void

### Function addLabels

![][public]

```cpp theme={null}
void ansys::dpf::CollectionBase::addLabels(std::vector< std::string > const &labels)
```

Add vector of labels to field.

**Parameters**:

* std::vector\< std::string > const & **labels**: \[in] Vector of labels to add.

**Return type**: void

### Function getSizeFor

![][public]
![][const]

```cpp theme={null}
dp_int ansys::dpf::CollectionBase::getSizeFor(LabelSpace const &lab_space) const
```

**Returns**:

Number of entries for given [LabelSpace](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-labelspace.md).

**Parameters**:

* [LabelSpace](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-labelspace.md) const & **lab\_space**: \[in] [LabelSpace](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-labelspace.md) for which to get number of entries.

**Return type**: [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0)

### Function labels

![][public]
![][const]

```cpp theme={null}
std::vector< std::string > ansys::dpf::CollectionBase::labels() const
```

**Returns**:

Vector of labels of entries container.

**Return type**: std::vector\< std::string >

### Function getLabelSpace

![][public]
![][const]

```cpp theme={null}
LabelSpace ansys::dpf::CollectionBase::getLabelSpace(dp_index index) const
```

**Returns**:

[LabelSpace](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-labelspace.md) for given field index.

**Parameters**:

* [dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **index**: \[in] Index of field.

**Return type**: [LabelSpace](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-labelspace.md)

### Function labelScoping

![][public]
![][const]

```cpp theme={null}
Scoping ansys::dpf::CollectionBase::labelScoping(std::string const &label) const
```

**Returns**:

[Scoping](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-scoping.md) for field given by label.

**Parameters**:

* std::string const & **label**: \[in] [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) for which to get scoping.

**Return type**: [Scoping](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-scoping.md)

### Function hasLabel

![][public]
![][const]

```cpp theme={null}
bool ansys::dpf::CollectionBase::hasLabel(std::string const &label) const
```

**Returns**:

Indication that CollectionBase has field given by label.

**Parameters**:

* std::string const & **label**: \[in] [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) label.

**Return type**: bool

### Function support

![][public]
![][const]

```cpp theme={null}
Support ansys::dpf::CollectionBase::support(std::string const &label=labels::time) const
```

**Returns**:

[Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-support.md) for given label.

**Parameters**:

* std::string const & **label** = [labels::time](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-labels.md#structansys-dpf-labels-1a22ee1a5e3be8ad98c20c5ca52e247914) : \[in] [Label](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-label.md) for which to get [Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-support.md).

**Return type**: [Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-support.md)

### Function setSupport

![][public]

```cpp theme={null}
void ansys::dpf::CollectionBase::setSupport(ansys::dpf::Support const &support, std::string const &label=labels::time)
```

Set [Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-support.md) for given label.

**Parameters**:

* [ansys::dpf::Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-support.md) const & **support**: \[in] [Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-support.md) value.
* std::string const & **label** = [labels::time](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-labels.md#structansys-dpf-labels-1a22ee1a5e3be8ad98c20c5ca52e247914) : \[in] [Label](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-label.md) for which to set support.

**Return type**: void

### Function setSupport

![][public]

```cpp theme={null}
void ansys::dpf::CollectionBase::setSupport(ansys::dpf::TimeFreqSupport const &support, std::string const &label=labels::time)
```

Set [TimeFreqSupport](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-timefreqsupport.md) for given label.

**Parameters**:

* [ansys::dpf::TimeFreqSupport](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-timefreqsupport.md) const & **support**: \[in] [Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-support.md) value.
* std::string const & **label** = [labels::time](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-labels.md#structansys-dpf-labels-1a22ee1a5e3be8ad98c20c5ca52e247914) : \[in] [Label](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-label.md) for which to set support.

**Return type**: void

### Function name

![][public]
![][const]

```cpp theme={null}
std::string ansys::dpf::CollectionBase::name() const
```

**Returns**:

Name of CollectionBase.

**Return type**: std::string

### Function setName

![][public]

```cpp theme={null}
void ansys::dpf::CollectionBase::setName(std::string const &name)
```

Set name of CollectionBase.

**Parameters**:

* std::string const & **name**: \[in] New name.

**Return type**: void

### Function id

![][public]
![][const]

```cpp theme={null}
dp_id ansys::dpf::CollectionBase::id() const
```

**Returns**:

Id of CollectionBase.

**Return type**: [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e)

### Function setId

![][public]

```cpp theme={null}
void ansys::dpf::CollectionBase::setId(dp_id id)
```

Set Id of CollectionBase.

**Parameters**:

* [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e) **id**: \[in] New id.

**Return type**: void

[C++]: https://img.shields.io/badge/language-C%2B%2B-blue "C++"

[const]: https://img.shields.io/badge/-const-lightblue "const"

[public]: https://img.shields.io/badge/-public-brightgreen "public"

[static]: https://img.shields.io/badge/-static-lightgrey "static"
