> ## 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::StringField

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

Holds string data describing a Property located on given entities (the [StringField](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-stringfield.md)'s data is bounded with its scoping). Is the equivalent of the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) but with string values data (and not double values).

**Inherits from**:

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

## Members

* [callAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aea34d37e0c080126eff70db34bf46597)
* [data](#classansys-dpf-stringfield-1a4c6e1215a605ec027834fb45ae658fd7)
* [dataSize](#classansys-dpf-stringfield-1aeba443e66b156da5c91910e924cb2e7f)
* [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)
* [emptyStringField](#classansys-dpf-stringfield-1ada5af3070f3550810a80a2130b816e4e)
* [entityData](#classansys-dpf-stringfield-1ae4d965f29b0169db846487806a63f0ae)
* [entityDataById](#classansys-dpf-stringfield-1a640dbd602194655feae974b6661a0864)
* [getClient](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a968afd9daa0b0f13b65a2ac61369d73a)
* [getData](#classansys-dpf-stringfield-1ae411e3f2e6c484b88ae6bb0388ab5126)
* [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)
* [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)
* [location](#classansys-dpf-stringfield-1a36498c54c9f757124419a3bc56218339)
* [operator=](#classansys-dpf-stringfield-1a8c5b159bd81a9ed0479e5a7552230d9d)
* [operator=](#classansys-dpf-stringfield-1ac803950756f1fbf53ad35e02604fb9b6)
* [push\_back](#classansys-dpf-stringfield-1a06eaa63c638cbe234067442096a3318a)
* [push\_back](#classansys-dpf-stringfield-1a9371a94961b517ac01791fff526a00d1)
* [reserve](#classansys-dpf-stringfield-1a87afeb83d4e137acc852fcc620ce232c)
* [resize](#classansys-dpf-stringfield-1aec82d7162816699fa809d59547545b76)
* [scoping](#classansys-dpf-stringfield-1aeeb9940f52222c264618d0788360300a)
* [setData](#classansys-dpf-stringfield-1a75fe878c8660665182a13809d521aee8)
* [setScoping](#classansys-dpf-stringfield-1a0b6d8c1c684bc28745a7f7c274c9b49d)
* [StringField](#classansys-dpf-stringfield-1a6515537907890dc10ff89602c897a960)
* [StringField](#classansys-dpf-stringfield-1a25f8ec9565065dd41156b707ecde16f2)
* [StringField](#classansys-dpf-stringfield-1a89883fda363ca4d9447b12492fa2cea2)
* [StringField](#classansys-dpf-stringfield-1ac32f4025219a0e1e03cea942fef67fc1)
* [StringField](#classansys-dpf-stringfield-1ac2c96f3bd937542c25f6640fe9765019)
* [\~DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ab7c83b6ea160c2b115e056f6c312112f)
* [\~StringField](#classansys-dpf-stringfield-1a5da02acc15e3c94f278e054e2efc2bc7)

## Friends

## Public static functions

### Function emptyStringField

![][public]
![][static]

```cpp theme={null}
static StringField ansys::dpf::StringField::emptyStringField()
```

**Return type**: StringField

## Public functions

### Function \~StringField

![][public]

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

**Return type**:

### Function StringField

![][public]

```cpp theme={null}
ansys::dpf::StringField::StringField(Client const *const client, dp_int number_of_entities=0, dp_int data_size=0)
```

Create an empty property field with a client.

**Parameters**:

* [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client**: \[in] [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) to create the property field on.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **number\_of\_entities** = 0 : \[in] Number of entities reserved.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **data\_size** = 0 : \[in] Reserved size of data.

**Return type**:

### Function StringField

![][public]

```cpp theme={null}
ansys::dpf::StringField::StringField(int id, Client const *const client)
```

Retrieve an existing instance of [StringField](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-stringfield.md) on a server.

**Parameters**:

* int **id**: \[in] Id of the [StringField](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-stringfield.md) object on the server's database.
* [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client**: \[in] [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) instance designating the IP, port and protocol to use.

**Return type**:

### Function StringField

![][public]

```cpp theme={null}
ansys::dpf::StringField::StringField(dp_int number_of_entities=0, dp_int data_size=0)
```

Create a property with number of entities and data size.

**Parameters**:

* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **number\_of\_entities** = 0 : \[in] Number of entities reserved.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **data\_size** = 0 : \[in] Reserved size of data.

**Return type**:

### Function StringField

![][public]

```cpp theme={null}
ansys::dpf::StringField::StringField(StringField const &)
```

**Parameters**:

* StringField const &

**Return type**:

### Function StringField

![][public]

```cpp theme={null}
ansys::dpf::StringField::StringField(StringField &&) noexcept
```

**Parameters**:

* StringField &&

**Return type**:

### Function operator=

![][public]

```cpp theme={null}
StringField & ansys::dpf::StringField::operator=(StringField const &)
```

**Parameters**:

* StringField const &

**Return type**: StringField &

### Function operator=

![][public]

```cpp theme={null}
StringField & ansys::dpf::StringField::operator=(StringField &&) noexcept
```

**Parameters**:

* StringField &&

**Return type**: StringField &

### Function location

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

```cpp theme={null}
Location ansys::dpf::StringField::location() const
```

**Returns**:

[Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-location.md) of the property.

**Return type**: [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-location.md)

### Function scoping

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

```cpp theme={null}
Scoping ansys::dpf::StringField::scoping() const
```

**Returns**:

[Scoping](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-scoping.md) of the property.

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

### Function dataSize

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

```cpp theme={null}
dp_int ansys::dpf::StringField::dataSize() const
```

**Returns**:

Size of the data container.

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

### Function push\_back

![][public]

```cpp theme={null}
void ansys::dpf::StringField::push_back(dp_id entity_id, std::vector< std::string > const &values)
```

Push back the entity data.

**Parameters**:

* [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e) **entity\_id**: \[in] Id of entity for which to push data.
* std::vector\< std::string > const & **values**: \[in] Vector of data for entity.

**Return type**: void

### Function push\_back

![][public]

```cpp theme={null}
void ansys::dpf::StringField::push_back(dp_id entity_id, const std::string *values, dp_index size)
```

Push back the entity data.

**Parameters**:

* [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e) **entity\_id**: \[in] Id of entity for which to push data.
* const std::string \* **values**: \[in] Vector of data for entity.
* [dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **size**: \[in] Number of entities.

**Return type**: void

### Function setData

![][public]

```cpp theme={null}
void ansys::dpf::StringField::setData(std::vector< std::string > const &data)
```

Set the data of the property field.

**Parameters**:

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

**Return type**: void

### Function setScoping

![][public]

```cpp theme={null}
void ansys::dpf::StringField::setScoping(ansys::dpf::Scoping &s)
```

Set the scoping of the property field.

**Parameters**:

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

**Return type**: void

### Function data

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

```cpp theme={null}
DpfVector< std::string > ansys::dpf::StringField::data() const
```

**Returns**:

[DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpfvector.md) of data array.

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

### Function getData

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

```cpp theme={null}
void ansys::dpf::StringField::getData(std::vector< std::string > &values_to_fill) const
```

Get all data for property entities.

**Parameters**:

* std::vector\< std::string > & **values\_to\_fill**: \[out] Property entity data.

**Return type**: void

### Function entityData

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

```cpp theme={null}
void ansys::dpf::StringField::entityData(dp_index entity_index, DpfVector< std::string > &data) const
```

**Returns**:

[DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpfvector.md) of data array of an entity, by index.

**Parameters**:

* [dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **entity\_index**: \[in] Index of entity for which to get data.
* DpfVector\< std::string > & **data**: \[out] Pointer to the data.

**Return type**: void

### Function entityDataById

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

```cpp theme={null}
void ansys::dpf::StringField::entityDataById(dp_id entity_id, DpfVector< std::string > &data) const
```

**Returns**:

[DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpfvector.md) of data array of an entity, by id.

**Parameters**:

* [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e) **entity\_id**: \[in] Id of entity for which to get data.
* DpfVector\< std::string > & **data**: \[out] Pointer to the data.

**Return type**: void

### Function reserve

![][public]

```cpp theme={null}
void ansys::dpf::StringField::reserve(dp_int number_of_entities, dp_int overall_size=0)
```

Reserve the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md). Only implemented for in process udage. To reserve the size for gRPC usage, use the constructor.

**Parameters**:

* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **number\_of\_entities**: \[in] Number of entities.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **overall\_size** = 0 : \[in] Total size of entity data.

**Return type**: void

### Function resize

![][public]

```cpp theme={null}
void ansys::dpf::StringField::resize(dp_int number_of_entities, dp_int overall_size)
```

Reserve the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Parameters**:

* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **number\_of\_entities**: \[in] Number of entities.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **overall\_size**: \[in] Total size of entity data.

**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"
