    

 ## On this page

  

 

 # Class ansys::dpf::DataTree

 Last update: 25.03.2026 

<a id="classansys-dpf-datatree"></a>

![](https://img.shields.io/badge/language-C%2B%2B-blue "C++")![](https://img.shields.io/badge/-public-brightgreen "public")

Define a DOM (Document-Object-Model) tree.

**Inherits from**:

- [ansys::dpf::DpfTypes](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes)

## Members

- [callAPI](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aea34d37e0c080126eff70db34bf46597)
- [DataTree](classansys-dpf-datatree.md#classansys-dpf-datatree-1a714aa51770a0ae1efb1ddd2235a5820b)
- [DataTree](classansys-dpf-datatree.md#classansys-dpf-datatree-1a1c47166bd00e9a3168a9f045f6de1e0e)
- [DataTree](classansys-dpf-datatree.md#classansys-dpf-datatree-1a45794f55475843de36a620e6bf8a24a6)
- [DataTree](classansys-dpf-datatree.md#classansys-dpf-datatree-1ac1f6ad1c7025ca6ac20082a530e9dd06)
- [deep\_copy](classansys-dpf-datatree.md#classansys-dpf-datatree-1a746e4dbff0a937ee9c71564d6674987a)
- [describe](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a9977945710983bc03d2940fa007847b2)
- [empty](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a39cd546c42518e2332be8f287db95459)
- [emptyDataTree](classansys-dpf-datatree.md#classansys-dpf-datatree-1afb0171dc88164d841e4d8d1d14c8dc92)
- [fillFromJson](classansys-dpf-datatree.md#classansys-dpf-datatree-1a3772c0ff3572c7f84c4c05502e425d08)
- [fillFromTxt](classansys-dpf-datatree.md#classansys-dpf-datatree-1a64415f0ebdf85080a7c413edc24114d2)
- [getAvailableAttributeNames](classansys-dpf-datatree.md#classansys-dpf-datatree-1a387ca479f3cfbc9108525f61b7572302)
- [getAvailableSubTreeNames](classansys-dpf-datatree.md#classansys-dpf-datatree-1a2cf094e8fce213c47869123396bac585)
- [getBoolAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a41c18162d9ba5e12d81b2a5f85d7466d)
- [getClient](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a968afd9daa0b0f13b65a2ac61369d73a)
- [getDoubleAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a266762d4a1dfcd0a6f939a4107226fca)
- [getIntAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1aafba734273a1af1c2fd85194e05231c1)
- [getStringAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1ab465ed6523a35c0ebc9483252aea6840)
- [getSubByName](classansys-dpf-datatree.md#classansys-dpf-datatree-1a5c2cf876663f094d2fd3f54c7975a111)
- [getUnsignedIntAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a76fe3c29a72f34c67b8f3579df025dd4)
- [getVectDoubleAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1acf243a39659235e13f99dc528ee231e4)
- [getVectIntAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1ae5e9c8f83518bcb2435e9b5244c7e456)
- [getVectStringAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1af681fa5a409b85b8015af80b8d0f3bf5)
- [hasAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a3422a0cbc6d69c9dd91ea7a5cb5869bb)
- [hasBeenMovedLocally](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a1a5634202c15404b6b24e8f50e51cb66)
- [hasInternalObject](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ae198f89868d85c7db6dc1a934a1d3c15)
- [hasSub](classansys-dpf-datatree.md#classansys-dpf-datatree-1a6d1859fee7564672cbf1a85d9d8bb492)
- [isOnCommonAPI](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a9f9789ff61cc9d400a2a344830706b73)
- [isSameObject](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aa64d5f8fcd7d85ad6ebf708494dbefd7)
- [makeBoolAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a12d088c2d4aecb4d7ad4e28b400cd9c1)
- [makeDoubleAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1aa2d8b58119590de684d399072435b565)
- [makeIntAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a00f7067a548e3ca2dc21ac63bf1f4e13)
- [makeStringAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a82714e5e01a67de376d2e0e53bb1e126)
- [makeSub](classansys-dpf-datatree.md#classansys-dpf-datatree-1aa18973ec995c9088d1d6abb65c7660ff)
- [makeSubTreeAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a09a963609da9eb0092bf1d8658def177)
- [makeUnsignedIntAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1ae4120d3564517f8481feddb749940e32)
- [makeVectDoubleAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a13ea47ce80b84b62943ae7048d119484)
- [makeVectIntAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a40c87dbd75b43d54a01f6a2326952a50)
- [makeVectStringAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1aa03b920ab02e60829acc9587f9bf51fc)
- [operator=](classansys-dpf-datatree.md#classansys-dpf-datatree-1a859b20aa1351b9551e1e0cf9e6350fd1)
- [operator=](classansys-dpf-datatree.md#classansys-dpf-datatree-1afda6bb8faac2ce7a833928bd0a740739)
- [tryGetBoolAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1adbd30bd4c40e71abe1cbecf49023c0ab)
- [tryGetDoubleAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a4cc6693778f3db06b93e51a398c3e716)
- [tryGetIntAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a3e62c3b70df697e040677884529f501e)
- [tryGetStringAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a15e1d291c77b1220d1a1df12320e2aa7)
- [tryGetUnsignedIntAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a682e61166e908af29bfca74d9c2c0aa6)
- [tryGetVectDoubleAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1ae9e204844851300d1613bf1fc8ed33fc)
- [tryGetVectIntAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1ac81aeefaca719783f1b79e41dc5a3e68)
- [tryGetVectStringAttribute](classansys-dpf-datatree.md#classansys-dpf-datatree-1a677df71a1a093b48bdad8dccf575ce15)
- [writeToJson](classansys-dpf-datatree.md#classansys-dpf-datatree-1a3fc23d000373acf82b7be9d9689ff957)
- [writeToTxt](classansys-dpf-datatree.md#classansys-dpf-datatree-1a2f6cbbcca9c04de9a5d1821ab1f85d38)
- [~DataTree](classansys-dpf-datatree.md#classansys-dpf-datatree-1ab23976ff8a55c6f97d5b0ad82aea1ee1)
- [~DpfTypes](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ab7c83b6ea160c2b115e056f6c312112f)

## Friends

## Public functions

<a id="classansys-dpf-datatree-1a714aa51770a0ae1efb1ddd2235a5820b"></a>

### Function DataTree

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

```cpp
ansys::dpf::DataTree::DataTree()

```

**Return type**:

<a id="classansys-dpf-datatree-1a1c47166bd00e9a3168a9f045f6de1e0e"></a>

### Function DataTree

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

```cpp
ansys::dpf::DataTree::DataTree(Client const *const client)

```

**Parameters**:

- [Client](classansys-dpf-client.md#classansys-dpf-client) const \*const **client**: \[in\] [Client](classansys-dpf-client.md#classansys-dpf-client) instance designating the IP, port and protocol to use.

**Return type**:

<a id="classansys-dpf-datatree-1ab23976ff8a55c6f97d5b0ad82aea1ee1"></a>

### Function ~DataTree

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

```cpp
ansys::dpf::DataTree::~DataTree()

```

**Return type**:

<a id="classansys-dpf-datatree-1a45794f55475843de36a620e6bf8a24a6"></a>

### Function DataTree

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

```cpp
ansys::dpf::DataTree::DataTree(DataTree const &)

```

**Parameters**:

- DataTree const &amp;

**Return type**:

<a id="classansys-dpf-datatree-1ac1f6ad1c7025ca6ac20082a530e9dd06"></a>

### Function DataTree

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

```cpp
ansys::dpf::DataTree::DataTree(DataTree &&) noexcept

```

**Parameters**:

- DataTree &amp;&amp;

**Return type**:

<a id="classansys-dpf-datatree-1a859b20aa1351b9551e1e0cf9e6350fd1"></a>

### Function operator=

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

```cpp
DataTree & ansys::dpf::DataTree::operator=(DataTree const &)

```

**Parameters**:

- DataTree const &amp;

**Return type**: DataTree &amp;

<a id="classansys-dpf-datatree-1afda6bb8faac2ce7a833928bd0a740739"></a>

### Function operator=

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

```cpp
DataTree & ansys::dpf::DataTree::operator=(DataTree &&) noexcept

```

**Parameters**:

- DataTree &amp;&amp;

**Return type**: DataTree &amp;

<a id="classansys-dpf-datatree-1a3772c0ff3572c7f84c4c05502e425d08"></a>

### Function fillFromJson

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
void ansys::dpf::DataTree::fillFromJson(std::istream const &stream) const

```

Fill this data tree with the content of a json file generated by another tree (See [DataTree::writeToJson](classansys-dpf-datatree.md#classansys-dpf-datatree-1a3fc23d000373acf82b7be9d9689ff957)).

**Parameters**:

- std::istream const &amp; **stream**

**Return type**: void

<a id="classansys-dpf-datatree-1a64415f0ebdf85080a7c413edc24114d2"></a>

### Function fillFromTxt

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
void ansys::dpf::DataTree::fillFromTxt(std::istream const &stream) const

```

Fill this data tree with the content of a txt file generated by another tree (See [DataTree::writeToTxt](classansys-dpf-datatree.md#classansys-dpf-datatree-1a2f6cbbcca9c04de9a5d1821ab1f85d38)).

**Parameters**:

- std::istream const &amp; **stream**

**Return type**: void

<a id="classansys-dpf-datatree-1a2f6cbbcca9c04de9a5d1821ab1f85d38"></a>

### Function writeToTxt

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
void ansys::dpf::DataTree::writeToTxt(std::ostream &stream) const

```

Write the attributes and the subtrees of this data tree as text in a c++ standard output stream (example: std::ofstream, std::ostringstream).

**Parameters**:

- std::ostream &amp; **stream**

**Return type**: void

<a id="classansys-dpf-datatree-1a3fc23d000373acf82b7be9d9689ff957"></a>

### Function writeToJson

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
void ansys::dpf::DataTree::writeToJson(std::ostream &stream) const

```

Write the attributes and the subtrees of this data tree in a json like format in a c++ standard output stream (example: std::ofstream, std::ostringstream).

**Parameters**:

- std::ostream &amp; **stream**

**Return type**: void

<a id="classansys-dpf-datatree-1a387ca479f3cfbc9108525f61b7572302"></a>

### Function getAvailableAttributeNames

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
std::vector< std::string > ansys::dpf::DataTree::getAvailableAttributeNames() const

```

**Returns**:

the list of attributes names available (without recursivity in the subtrees).

**Return type**: std::vector&lt; std::string &gt;

<a id="classansys-dpf-datatree-1a2cf094e8fce213c47869123396bac585"></a>

### Function getAvailableSubTreeNames

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
std::vector< std::string > ansys::dpf::DataTree::getAvailableSubTreeNames() const

```

**Returns**:

the list of first rank substree names available (without recursivity in the subtrees).

**Return type**: std::vector&lt; std::string &gt;

<a id="classansys-dpf-datatree-1a5c2cf876663f094d2fd3f54c7975a111"></a>

### Function getSubByName

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
const DataTree ansys::dpf::DataTree::getSubByName(std::string const &name) const

```

**Returns**:

a subtree by its name (return an empty substree if it doesn't exist).

**Parameters**:

- std::string const &amp; **name**

**Return type**: const DataTree

<a id="classansys-dpf-datatree-1aafba734273a1af1c2fd85194e05231c1"></a>

### Function getIntAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
int ansys::dpf::DataTree::getIntAttribute(std::string const &name, int default_value=0) const

```

**Returns**:

an attribute by its name.

**Parameters**:

- **Name**: of the attribute.
- **Default**: value of the attribute. @information: if the attribute doesn't exist, the default value is returned.

**Parameters**:

- std::string const &amp; **name**
- int **default\_value** = 0

**Return type**: int

<a id="classansys-dpf-datatree-1a3e62c3b70df697e040677884529f501e"></a>

### Function tryGetIntAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::tryGetIntAttribute(std::string const &name, int &value) const

```

Get an attribute by its name.

Available since Ansys 2025R2. **Parameters**:

- **Name**: of the attribute.
- **Output**: value of the attribute.

**Returns**:

true if the attribute exists, false otherwise.

**Parameters**:

- std::string const &amp; **name**
- int &amp; **value**

**Return type**: bool

<a id="classansys-dpf-datatree-1a41c18162d9ba5e12d81b2a5f85d7466d"></a>

### Function getBoolAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::getBoolAttribute(std::string const &name, bool default_value=false) const

```

**Returns**:

an attribute by its name.

**Parameters**:

- **Name**: of the attribute.
- **Default**: value of the attribute. @information: if the attribute doesn't exist, the default value is returned.

**Parameters**:

- std::string const &amp; **name**
- bool **default\_value** = false

**Return type**: bool

<a id="classansys-dpf-datatree-1adbd30bd4c40e71abe1cbecf49023c0ab"></a>

### Function tryGetBoolAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::tryGetBoolAttribute(std::string const &name, bool &value) const

```

Get an attribute by its name.

Available since Ansys 2025R2. **Parameters**:

- **Name**: of the attribute.
- **Output**: value of the attribute.

**Returns**:

true if the attribute exists, false otherwise.

**Parameters**:

- std::string const &amp; **name**
- bool &amp; **value**

**Return type**: bool

<a id="classansys-dpf-datatree-1a76fe3c29a72f34c67b8f3579df025dd4"></a>

### Function getUnsignedIntAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
unsigned int ansys::dpf::DataTree::getUnsignedIntAttribute(std::string const &name, unsigned int default_value=0) const

```

**Returns**:

an attribute by its name.

**Parameters**:

- **Name**: of the attribute.
- **Default**: value of the attribute. @information: if the attribute doesn't exist, the default value is returned.

**Parameters**:

- std::string const &amp; **name**
- unsigned int **default\_value** = 0

**Return type**: unsigned int

<a id="classansys-dpf-datatree-1a682e61166e908af29bfca74d9c2c0aa6"></a>

### Function tryGetUnsignedIntAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::tryGetUnsignedIntAttribute(std::string const &name, unsigned int &value) const

```

**Returns**:

an attribute by its name.

Available since Ansys 2025R2. **Parameters**:

- **Name**: of the attribute.
- **Output**: value of the attribute.

**Returns**:

true if the attribute exists, false otherwise.

**Parameters**:

- std::string const &amp; **name**
- unsigned int &amp; **value**

**Return type**: bool

<a id="classansys-dpf-datatree-1a266762d4a1dfcd0a6f939a4107226fca"></a>

### Function getDoubleAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
double ansys::dpf::DataTree::getDoubleAttribute(std::string const &name, double default_value=0.0) const

```

**Returns**:

an attribute by its name.

**Parameters**:

- **Name**: of the attribute.
- **Default**: value of the attribute. @information: if the attribute doesn't exist, the default value is returned.

**Parameters**:

- std::string const &amp; **name**
- double **default\_value** = 0.0

**Return type**: double

<a id="classansys-dpf-datatree-1a4cc6693778f3db06b93e51a398c3e716"></a>

### Function tryGetDoubleAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::tryGetDoubleAttribute(std::string const &name, double &value) const

```

**Returns**:

an attribute by its name.

Available since Ansys 2025R2. **Parameters**:

- **Name**: of the attribute.
- **Output**: value of the attribute.

**Returns**:

true if the attribute exists, false otherwise.

**Parameters**:

- std::string const &amp; **name**
- double &amp; **value**

**Return type**: bool

<a id="classansys-dpf-datatree-1ab465ed6523a35c0ebc9483252aea6840"></a>

### Function getStringAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
std::string ansys::dpf::DataTree::getStringAttribute(std::string const &name, std::string="") const

```

**Returns**:

an attribute by its name.

**Parameters**:

- **Name**: of the attribute.
- **Default**: value of the attribute. @information: if the attribute doesn't exist, the default value is returned.

**Parameters**:

- std::string const &amp; **name**
- std::string = ""

**Return type**: std::string

<a id="classansys-dpf-datatree-1a15e1d291c77b1220d1a1df12320e2aa7"></a>

### Function tryGetStringAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::tryGetStringAttribute(std::string const &name, std::string &value) const

```

**Returns**:

an attribute by its name.

Available since Ansys 2025R2. **Parameters**:

- **Name**: of the attribute.
- **Output**: value of the attribute.

**Returns**:

true if the attribute exists, false otherwise.

**Parameters**:

- std::string const &amp; **name**
- std::string &amp; **value**

**Return type**: bool

<a id="classansys-dpf-datatree-1ae5e9c8f83518bcb2435e9b5244c7e456"></a>

### Function getVectIntAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
std::vector< int > ansys::dpf::DataTree::getVectIntAttribute(std::string const &name, std::vector< int > default_value={}) const

```

**Returns**:

an attribute by its name

**Parameters**:

- **Name**: of the attribute.
- **Default**: value of the attribute. @information: if the attribute doesn't exist, the default value is returned.

**Parameters**:

- std::string const &amp; **name**
- std::vector&lt; int &gt; **default\_value** = {}

**Return type**: std::vector&lt; int &gt;

<a id="classansys-dpf-datatree-1ac81aeefaca719783f1b79e41dc5a3e68"></a>

### Function tryGetVectIntAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::tryGetVectIntAttribute(std::string const &name, std::vector< int > &value) const

```

**Returns**:

an attribute by its name.

Available since Ansys 2025R2. **Parameters**:

- **Name**: of the attribute.
- **Output**: value of the attribute.

**Returns**:

true if the attribute exists, false otherwise.

**Parameters**:

- std::string const &amp; **name**
- std::vector&lt; int &gt; &amp; **value**

**Return type**: bool

<a id="classansys-dpf-datatree-1acf243a39659235e13f99dc528ee231e4"></a>

### Function getVectDoubleAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
std::vector< double > ansys::dpf::DataTree::getVectDoubleAttribute(std::string const &name, std::vector< double > default_value={}) const

```

**Returns**:

an attribute by its name.

**Parameters**:

- **Name**: of the attribute.
- **Default**: value of the attribute. @information: if the attribute doesn't exist, the default value is returned.

**Parameters**:

- std::string const &amp; **name**
- std::vector&lt; double &gt; **default\_value** = {}

**Return type**: std::vector&lt; double &gt;

<a id="classansys-dpf-datatree-1ae9e204844851300d1613bf1fc8ed33fc"></a>

### Function tryGetVectDoubleAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::tryGetVectDoubleAttribute(std::string const &name, std::vector< double > &value) const

```

**Returns**:

an attribute by its name.

Available since Ansys 2025R2. **Parameters**:

- **Name**: of the attribute.
- **Output**: value of the attribute.

**Returns**:

true if the attribute exists, false otherwise.

**Parameters**:

- std::string const &amp; **name**
- std::vector&lt; double &gt; &amp; **value**

**Return type**: bool

<a id="classansys-dpf-datatree-1af681fa5a409b85b8015af80b8d0f3bf5"></a>

### Function getVectStringAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
std::vector< std::string > ansys::dpf::DataTree::getVectStringAttribute(std::string const &name, std::vector< std::string > default_value={}) const

```

**Returns**:

an attribute by its name.

**Parameters**:

- **Name**: of the attribute.
- **Default**: value of the attribute. @information: if the attribute doesn't exist, the default value is returned.

**Parameters**:

- std::string const &amp; **name**
- std::vector&lt; std::string &gt; **default\_value** = {}

**Return type**: std::vector&lt; std::string &gt;

<a id="classansys-dpf-datatree-1a677df71a1a093b48bdad8dccf575ce15"></a>

### Function tryGetVectStringAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::tryGetVectStringAttribute(std::string const &name, std::vector< std::string > &value) const

```

**Returns**:

an attribute by its name.

Available since Ansys 2025R2. **Parameters**:

- **Name**: of the attribute.
- **Output**: value of the attribute.

**Returns**:

true if the attribute exists, false otherwise.

**Parameters**:

- std::string const &amp; **name**
- std::vector&lt; std::string &gt; &amp; **value**

**Return type**: bool

<a id="classansys-dpf-datatree-1a00f7067a548e3ca2dc21ac63bf1f4e13"></a>

### Function makeIntAttribute

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

```cpp
void ansys::dpf::DataTree::makeIntAttribute(std::string const &name, int value)

```

create or replace an attribute.

**Parameters**:

- std::string const &amp; **name**
- int **value**

**Return type**: void

<a id="classansys-dpf-datatree-1a12d088c2d4aecb4d7ad4e28b400cd9c1"></a>

### Function makeBoolAttribute

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

```cpp
void ansys::dpf::DataTree::makeBoolAttribute(std::string const &name, bool value)

```

create or replace an attribute.

**Parameters**:

- std::string const &amp; **name**
- bool **value**

**Return type**: void

<a id="classansys-dpf-datatree-1ae4120d3564517f8481feddb749940e32"></a>

### Function makeUnsignedIntAttribute

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

```cpp
void ansys::dpf::DataTree::makeUnsignedIntAttribute(std::string const &name, unsigned int value)

```

create or replace an attribute.

**Parameters**:

- std::string const &amp; **name**
- unsigned int **value**

**Return type**: void

<a id="classansys-dpf-datatree-1aa2d8b58119590de684d399072435b565"></a>

### Function makeDoubleAttribute

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

```cpp
void ansys::dpf::DataTree::makeDoubleAttribute(std::string const &name, double value)

```

create or replace an attribute.

**Parameters**:

- std::string const &amp; **name**
- double **value**

**Return type**: void

<a id="classansys-dpf-datatree-1a82714e5e01a67de376d2e0e53bb1e126"></a>

### Function makeStringAttribute

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

```cpp
void ansys::dpf::DataTree::makeStringAttribute(std::string const &name, std::string const &value)

```

create or replace an attribute.

**Parameters**:

- std::string const &amp; **name**
- std::string const &amp; **value**

**Return type**: void

<a id="classansys-dpf-datatree-1a40c87dbd75b43d54a01f6a2326952a50"></a>

### Function makeVectIntAttribute

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

```cpp
void ansys::dpf::DataTree::makeVectIntAttribute(std::string const &name, std::vector< int > const &value)

```

create or replace an attribute.

**Parameters**:

- std::string const &amp; **name**
- std::vector&lt; int &gt; const &amp; **value**

**Return type**: void

<a id="classansys-dpf-datatree-1a13ea47ce80b84b62943ae7048d119484"></a>

### Function makeVectDoubleAttribute

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

```cpp
void ansys::dpf::DataTree::makeVectDoubleAttribute(std::string const &name, std::vector< double > const &value)

```

create or replace an attribute.

**Parameters**:

- std::string const &amp; **name**
- std::vector&lt; double &gt; const &amp; **value**

**Return type**: void

<a id="classansys-dpf-datatree-1aa03b920ab02e60829acc9587f9bf51fc"></a>

### Function makeVectStringAttribute

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

```cpp
void ansys::dpf::DataTree::makeVectStringAttribute(std::string const &name, std::vector< std::string > const &value)

```

create or replace an attribute.

**Parameters**:

- std::string const &amp; **name**
- std::vector&lt; std::string &gt; const &amp; **value**

**Return type**: void

<a id="classansys-dpf-datatree-1aa18973ec995c9088d1d6abb65c7660ff"></a>

### Function makeSub

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

```cpp
DataTree ansys::dpf::DataTree::makeSub(std::string const &name)

```

create a subtree with a name. If the substree already exists, it is returned. **Returns**:

the created subtree to fill it.

**Parameters**:

- std::string const &amp; **name**

**Return type**: DataTree

<a id="classansys-dpf-datatree-1a09a963609da9eb0092bf1d8658def177"></a>

### Function makeSubTreeAttribute

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

```cpp
void ansys::dpf::DataTree::makeSubTreeAttribute(std::string const &name, DataTree const *const sub_tree)

```

**Parameters**:

- std::string const &amp; **name**
- DataTree const \*const **sub\_tree**

**Return type**: void

<a id="classansys-dpf-datatree-1a3422a0cbc6d69c9dd91ea7a5cb5869bb"></a>

### Function hasAttribute

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::hasAttribute(std::string const &attribute_name) const

```

**Returns**:

true if an attribute exists (accepts sub attributes by adding "/", example attribute\_name="sub\_name/attrib\_name").

**Parameters**:

- std::string const &amp; **attribute\_name**

**Return type**: bool

<a id="classansys-dpf-datatree-1a6d1859fee7564672cbf1a85d9d8bb492"></a>

### Function hasSub

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::DataTree::hasSub(std::string const &attribute_name) const

```

**Returns**:

true if a subtree exists.

**Parameters**:

- std::string const &amp; **attribute\_name**

**Return type**: bool

<a id="classansys-dpf-datatree-1a746e4dbff0a937ee9c71564d6674987a"></a>

### Function deep\_copy

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
DataTree ansys::dpf::DataTree::deep_copy(ansys::dpf::Client const *const client=nullptr) const

```

Make a deep copy on a given client.

**Parameters**:

- [ansys::dpf::Client](classansys-dpf-client.md#classansys-dpf-client) const \*const **client** = nullptr : \[in\] Remote client

**Return type**: DataTree

## Public static functions

<a id="classansys-dpf-datatree-1afb0171dc88164d841e4d8d1d14c8dc92"></a>

### Function emptyDataTree

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-static-lightgrey "static")

```cpp
static DataTree ansys::dpf::DataTree::emptyDataTree()

```

Create an empty [DataTree](classansys-dpf-datatree.md#classansys-dpf-datatree). **Returns**:

Empty [DataTree](classansys-dpf-datatree.md#classansys-dpf-datatree).

**Return type**: DataTree