    

 ## On this page

  

 

 # ansys::dpf::LabelSpace Class Reference

 Last update: 16.07.2025 

`#include <dpf_api.h>`

Inheritance diagram for ansys::dpf::LabelSpace:

 ![](/sites/default/files/migrate-content/dpf_cpp_client_library_2025_r1_1/classansys_1_1dpf_1_1LabelSpace.png)



## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

 [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml#a13b9bdced162f48db88fce361a9e6207) ([Client](classansys_1_1dpf_1_1Client.xhtml) const \*const client)  [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml#aaf340020154b829721665edaf63782b0) (std::map&lt; [Label](structansys_1_1dpf_1_1Label.xhtml), [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) &gt; const &amp;rhs, [Client](classansys_1_1dpf_1_1Client.xhtml) const \*const client)  [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml#ae24da9b938cc72d3323793a566a469e7) (std::initializer\_list&lt; std::pair&lt; const [Label](structansys_1_1dpf_1_1Label.xhtml), int &gt; &gt; init, [Client](classansys_1_1dpf_1_1Client.xhtml) const \*const client)  [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml#ab0df700b408197ea42d97e452dbd0337) (std::map&lt; [Label](structansys_1_1dpf_1_1Label.xhtml), [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) &gt; const &amp;rhs)  [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml#ab21565a3cb171e2c29b6d61bc28b193a) (std::initializer\_list&lt; std::pair&lt; const [Label](structansys_1_1dpf_1_1Label.xhtml), int &gt; &gt; init) <a id="a287d7e799f4f2ae23bd3de0028d51272" name="a287d7e799f4f2ae23bd3de0028d51272"></a> **LabelSpace** ([LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) const &amp;) <a id="a1e95d64b1f8eac710a4c4799cf6f9db6" name="a1e95d64b1f8eac710a4c4799cf6f9db6"></a> **LabelSpace** ([LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp;&amp;) noexcept <a id="ad1c50243ae1d2959743bb13f98142dc6" name="ad1c50243ae1d2959743bb13f98142dc6"></a>[LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; **operator=** ([LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) const &amp;) <a id="afdbf29825617b3b0b2cbd8da929d32ef" name="afdbf29825617b3b0b2cbd8da929d32ef"></a>[LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; **operator=** ([LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp;&amp;) noexcept void [add](classansys_1_1dpf_1_1LabelSpace.xhtml#ad9ba9b56c0035b68197893571372def3) ([Label](structansys_1_1dpf_1_1Label.xhtml) const &amp;label, [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) value) void [set](classansys_1_1dpf_1_1LabelSpace.xhtml#a01720b6c41dd542be5a53727356b6aa9) ([Label](structansys_1_1dpf_1_1Label.xhtml) const &amp;label, [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) value) void [erase](classansys_1_1dpf_1_1LabelSpace.xhtml#a987bf530c14c050fe9fe10eacaf886f3) ([Label](structansys_1_1dpf_1_1Label.xhtml) const &amp;label) [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) [size](classansys_1_1dpf_1_1LabelSpace.xhtml#a2bee3fab11075359f8b29fea2757ae5f) () const bool [has](classansys_1_1dpf_1_1LabelSpace.xhtml#a89cdb7a54e3ba4150072bd5d8ded7b32) ([Label](structansys_1_1dpf_1_1Label.xhtml) const &amp;label) const [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) [at](classansys_1_1dpf_1_1LabelSpace.xhtml#a587c2abcb548947202249204e854e51f) ([Label](structansys_1_1dpf_1_1Label.xhtml) const &amp;label) const std::string [labelsName](classansys_1_1dpf_1_1LabelSpace.xhtml#a5b6f5d2ede089e6518180f143b147124) ([dp\_index](namespaceansys_1_1dpf.xhtml#a417548d1b705a9ba54ba9429afe68920) index) const [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; [setTime](classansys_1_1dpf_1_1LabelSpace.xhtml#ad5660f1a3869849ab28ff29b822d5ea8) ([dp\_index](namespaceansys_1_1dpf.xhtml#a417548d1b705a9ba54ba9429afe68920) i) [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; [setDomain](classansys_1_1dpf_1_1LabelSpace.xhtml#aa47e223975ee54006ebb05fb071877a5) ([dp\_index](namespaceansys_1_1dpf.xhtml#a417548d1b705a9ba54ba9429afe68920) i) [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; [setComplex](classansys_1_1dpf_1_1LabelSpace.xhtml#a9a42fd2a57d80e6b82758e4db435d26e) ([dp\_index](namespaceansys_1_1dpf.xhtml#a417548d1b705a9ba54ba9429afe68920) i) [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; [addAnyTime](classansys_1_1dpf_1_1LabelSpace.xhtml#ab29ab2f6ac32715fbc5f8de6ea8016c8) () [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; [addAnyDomain](classansys_1_1dpf_1_1LabelSpace.xhtml#a784c57a7b13941ec85ddc44414002c2b) () [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) [deep\_copy](classansys_1_1dpf_1_1LabelSpace.xhtml#acddfde124cc45b380f14613aaed79767) ([ansys::dpf::Client](classansys_1_1dpf_1_1Client.xhtml) const \*const client=nullptr) const void [mergeWith](classansys_1_1dpf_1_1LabelSpace.xhtml#a02a19ef066b7070148398a794cce2f62) ([ansys::dpf::LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) const other) ![-](/sites/default/files/migrate-content/dpf_cpp_client_library_2025_r1_1/closed.png) Public Member Functions inherited from [ansys::dpf::DpfTypes](classansys_1_1dpf_1_1DpfTypes.xhtml)virtual bool [empty](classansys_1_1dpf_1_1DpfTypes.xhtml#a39cd546c42518e2332be8f287db95459) () const virtual bool [hasInternalObject](classansys_1_1dpf_1_1DpfTypes.xhtml#ae198f89868d85c7db6dc1a934a1d3c15) () const virtual std::string [describe](classansys_1_1dpf_1_1DpfTypes.xhtml#a9977945710983bc03d2940fa007847b2) () const so::API const \* [callAPI](classansys_1_1dpf_1_1DpfTypes.xhtml#aea34d37e0c080126eff70db34bf46597) () const bool [isOnCommonAPI](classansys_1_1dpf_1_1DpfTypes.xhtml#a9f9789ff61cc9d400a2a344830706b73) () const bool [getClient](classansys_1_1dpf_1_1DpfTypes.xhtml#a968afd9daa0b0f13b65a2ac61369d73a) ([Client](classansys_1_1dpf_1_1Client.xhtml) &amp;client) const bool [hasBeenMovedLocally](classansys_1_1dpf_1_1DpfTypes.xhtml#a1a5634202c15404b6b24e8f50e51cb66) () const bool [isSameObject](classansys_1_1dpf_1_1DpfTypes.xhtml#aa64d5f8fcd7d85ad6ebf708494dbefd7) ([DpfTypes](classansys_1_1dpf_1_1DpfTypes.xhtml) const &amp;rhs) const ## <a id="pub-static-methods" name="pub-static-methods"></a>Static Public Member Functions

static [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) [emptyLabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml#a50fe673ff484fd698d174a07ba8f74c4) () <a id="details" name="details"></a>## Detailed Description

Defines an indexation for fields container.

See also[Using collections and labels](group__group__12.xhtml) Examples[DataApis.cpp](DataApis_8cpp-example.xhtml#_a40), and [DataExport.cpp](DataExport_8cpp-example.xhtml#_a0).

## Constructor &amp; Destructor Documentation

<a id="a13b9bdced162f48db88fce361a9e6207" name="a13b9bdced162f48db88fce361a9e6207"></a>## [◆ ](#a13b9bdced162f48db88fce361a9e6207)LabelSpace() \[1/5\]

 ansys::dpf::LabelSpace::LabelSpace  ( [Client](classansys_1_1dpf_1_1Client.xhtml) const \*const  *client*) 

Create a new [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) for a given client.

Parameters \[in\]client[Client](classansys_1_1dpf_1_1Client.xhtml) instance designating the IP, port and protocol to use. 



<a id="aaf340020154b829721665edaf63782b0" name="aaf340020154b829721665edaf63782b0"></a>## [◆ ](#aaf340020154b829721665edaf63782b0)LabelSpace() \[2/5\]

 ansys::dpf::LabelSpace::LabelSpace  ( std::map&lt; [Label](structansys_1_1dpf_1_1Label.xhtml), [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) &gt; const &amp;  *rhs*,    [Client](classansys_1_1dpf_1_1Client.xhtml) const \*const  *client*   ) 

Consturct new [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) from labels and values.

Parameters \[in\]rhslabels and values with which to construct space. \[in\]client[Client](classansys_1_1dpf_1_1Client.xhtml) instance designating the IP, port and protocol to use. 



<a id="ae24da9b938cc72d3323793a566a469e7" name="ae24da9b938cc72d3323793a566a469e7"></a>## [◆ ](#ae24da9b938cc72d3323793a566a469e7)LabelSpace() \[3/5\]

 ansys::dpf::LabelSpace::LabelSpace  ( std::initializer\_list&lt; std::pair&lt; const [Label](structansys_1_1dpf_1_1Label.xhtml), int &gt; &gt;  *init*,    [Client](classansys_1_1dpf_1_1Client.xhtml) const \*const  *client*   ) 

Construct new [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) from pairs of labels and values.

Parameters \[in\]initList of label/value pairs. \[in\]client[Client](classansys_1_1dpf_1_1Client.xhtml) instance designating the IP, port and protocol to use. 



<a id="ab0df700b408197ea42d97e452dbd0337" name="ab0df700b408197ea42d97e452dbd0337"></a>## [◆ ](#ab0df700b408197ea42d97e452dbd0337)LabelSpace() \[4/5\]

 ansys::dpf::LabelSpace::LabelSpace  ( std::map&lt; [Label](structansys_1_1dpf_1_1Label.xhtml), [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) &gt; const &amp;  *rhs*) 

Consturct new [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) from labels and values.

Parameters \[in\]rhslabels and values with which to construct space. 



<a id="ab21565a3cb171e2c29b6d61bc28b193a" name="ab21565a3cb171e2c29b6d61bc28b193a"></a>## [◆ ](#ab21565a3cb171e2c29b6d61bc28b193a)LabelSpace() \[5/5\]

 ansys::dpf::LabelSpace::LabelSpace  ( std::initializer\_list&lt; std::pair&lt; const [Label](structansys_1_1dpf_1_1Label.xhtml), int &gt; &gt;  *init*) 

Construct new [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) from pairs of labels and values.

Parameters \[in\]initList of label/value pairs. 



## Member Function Documentation

<a id="ad9ba9b56c0035b68197893571372def3" name="ad9ba9b56c0035b68197893571372def3"></a>## [◆ ](#ad9ba9b56c0035b68197893571372def3)add()

 void ansys::dpf::LabelSpace::add  ( [Label](structansys_1_1dpf_1_1Label.xhtml) const &amp;  *label*,    [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0)  *value*   ) 

Add a label with value. If label already exists, nothing happens.

Parameters \[in\]label[Label](structansys_1_1dpf_1_1Label.xhtml) to add to [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml). \[in\]valueValue of label. 



<a id="a784c57a7b13941ec85ddc44414002c2b" name="a784c57a7b13941ec85ddc44414002c2b"></a>## [◆ ](#a784c57a7b13941ec85ddc44414002c2b)addAnyDomain()

 [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; ansys::dpf::LabelSpace::addAnyDomain  ( ) 

Set domain label to -1.

ReturnsReference to labelspace. See also[labels](structansys_1_1dpf_1_1labels.xhtml) 



<a id="ab29ab2f6ac32715fbc5f8de6ea8016c8" name="ab29ab2f6ac32715fbc5f8de6ea8016c8"></a>## [◆ ](#ab29ab2f6ac32715fbc5f8de6ea8016c8)addAnyTime()

 [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; ansys::dpf::LabelSpace::addAnyTime  ( ) 

Set time label to -1.

ReturnsReference to labelspace. See also[labels](structansys_1_1dpf_1_1labels.xhtml) 



<a id="a587c2abcb548947202249204e854e51f" name="a587c2abcb548947202249204e854e51f"></a>## [◆ ](#a587c2abcb548947202249204e854e51f)at()

 [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) ansys::dpf::LabelSpace::at  ( [Label](structansys_1_1dpf_1_1Label.xhtml) const &amp;  *label*)  const

ReturnsValue of label within space. Parameters \[in\]label[Label](structansys_1_1dpf_1_1Label.xhtml) of which to get value. 



<a id="acddfde124cc45b380f14613aaed79767" name="acddfde124cc45b380f14613aaed79767"></a>## [◆ ](#acddfde124cc45b380f14613aaed79767)deep\_copy()

 [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) ansys::dpf::LabelSpace::deep\_copy  ( [ansys::dpf::Client](classansys_1_1dpf_1_1Client.xhtml) const \*const  *client* = `nullptr`)  const

Create a new [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) on a server by copying all the data of this [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml).

Parameters \[in\]client[Client](classansys_1_1dpf_1_1Client.xhtml) instance designating the IP, port and protocol to use. 



<a id="a50fe673ff484fd698d174a07ba8f74c4" name="a50fe673ff484fd698d174a07ba8f74c4"></a>## [◆ ](#a50fe673ff484fd698d174a07ba8f74c4)emptyLabelSpace()

 static [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) ansys::dpf::LabelSpace::emptyLabelSpace  ( )   static 

Create an empty [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml)

ReturnsEmpty [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) 



<a id="a987bf530c14c050fe9fe10eacaf886f3" name="a987bf530c14c050fe9fe10eacaf886f3"></a>## [◆ ](#a987bf530c14c050fe9fe10eacaf886f3)erase()

 void ansys::dpf::LabelSpace::erase  ( [Label](structansys_1_1dpf_1_1Label.xhtml) const &amp;  *label*) 

Removes label from space.

Parameters \[in\]label[Label](structansys_1_1dpf_1_1Label.xhtml) to remove. 



<a id="a89cdb7a54e3ba4150072bd5d8ded7b32" name="a89cdb7a54e3ba4150072bd5d8ded7b32"></a>## [◆ ](#a89cdb7a54e3ba4150072bd5d8ded7b32)has()

 bool ansys::dpf::LabelSpace::has  ( [Label](structansys_1_1dpf_1_1Label.xhtml) const &amp;  *label*)  const

ReturnsIndication that label exists within space. Parameters \[in\]label[Label](structansys_1_1dpf_1_1Label.xhtml) of which to check existence. 



<a id="a5b6f5d2ede089e6518180f143b147124" name="a5b6f5d2ede089e6518180f143b147124"></a>## [◆ ](#a5b6f5d2ede089e6518180f143b147124)labelsName()

 std::string ansys::dpf::LabelSpace::labelsName  ( [dp\_index](namespaceansys_1_1dpf.xhtml#a417548d1b705a9ba54ba9429afe68920)  *index*)  const

Returnsname of label at given index. Parameters \[in\]indexIndex of the wanted label. 



<a id="a02a19ef066b7070148398a794cce2f62" name="a02a19ef066b7070148398a794cce2f62"></a>## [◆ ](#a02a19ef066b7070148398a794cce2f62)mergeWith()

 void ansys::dpf::LabelSpace::mergeWith  ( [ansys::dpf::LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) const  *other*) 

Inserts all labels and ids of other in this.





<a id="a01720b6c41dd542be5a53727356b6aa9" name="a01720b6c41dd542be5a53727356b6aa9"></a>## [◆ ](#a01720b6c41dd542be5a53727356b6aa9)set()

 void ansys::dpf::LabelSpace::set  ( [Label](structansys_1_1dpf_1_1Label.xhtml) const &amp;  *label*,    [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0)  *value*   ) 

Set an already existing label to value. If label does not exist it is added.

Parameters \[in\]label[Label](structansys_1_1dpf_1_1Label.xhtml) whose value to set. \[in\]valueNew value of label. 



<a id="a9a42fd2a57d80e6b82758e4db435d26e" name="a9a42fd2a57d80e6b82758e4db435d26e"></a>## [◆ ](#a9a42fd2a57d80e6b82758e4db435d26e)setComplex()

 [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; ansys::dpf::LabelSpace::setComplex  ( [dp\_index](namespaceansys_1_1dpf.xhtml#a417548d1b705a9ba54ba9429afe68920)  *i*) 

Set complex label to value.

ReturnsReference to labelspace. See also[labels](structansys_1_1dpf_1_1labels.xhtml) Parameters \[in\]iNew value for complex label. 



<a id="aa47e223975ee54006ebb05fb071877a5" name="aa47e223975ee54006ebb05fb071877a5"></a>## [◆ ](#aa47e223975ee54006ebb05fb071877a5)setDomain()

 [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; ansys::dpf::LabelSpace::setDomain  ( [dp\_index](namespaceansys_1_1dpf.xhtml#a417548d1b705a9ba54ba9429afe68920)  *i*) 

Set domain label to value

ReturnsReference to labelspace. See also[labels](structansys_1_1dpf_1_1labels.xhtml) Parameters \[in\]iNew value for domain label. 



<a id="ad5660f1a3869849ab28ff29b822d5ea8" name="ad5660f1a3869849ab28ff29b822d5ea8"></a>## [◆ ](#ad5660f1a3869849ab28ff29b822d5ea8)setTime()

 [LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) &amp; ansys::dpf::LabelSpace::setTime  ( [dp\_index](namespaceansys_1_1dpf.xhtml#a417548d1b705a9ba54ba9429afe68920)  *i*) 

Set time label to value.

ReturnsReference to labelspace. See also[labels](structansys_1_1dpf_1_1labels.xhtml) Parameters \[in\]iNew value for time label. 



<a id="a2bee3fab11075359f8b29fea2757ae5f" name="a2bee3fab11075359f8b29fea2757ae5f"></a>## [◆ ](#a2bee3fab11075359f8b29fea2757ae5f)size()

 [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) ansys::dpf::LabelSpace::size  ( )  const

ReturnsNumber of labels in space.