Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::LabelSpace Class Reference

Last update: 10.07.2023

#include <dpf_api.h>

Inheritance diagram for ansys::dpf::LabelSpace:
ansys::dpf::DpfTypes

Public Member Functions

 LabelSpace (Client const *const client)
 
 LabelSpace (std::map< Label, dp_int > const &rhs, Client const *const client)
 
 LabelSpace (std::initializer_list< std::pair< const Label, int > > init, Client const *const client)
 
 LabelSpace (std::map< Label, dp_int > const &rhs)
 
 LabelSpace (std::initializer_list< std::pair< const Label, int > > init)
 
 LabelSpace (LabelSpace const &)
 
 LabelSpace (LabelSpace &&)
 
LabelSpaceoperator= (LabelSpace const &)
 
LabelSpaceoperator= (LabelSpace &&)
 
void add (Label const &label, dp_int value)
 
void set (Label const &label, dp_int value)
 
void erase (Label const &label)
 
dp_int size () const
 
bool has (Label const &label) const
 
dp_int at (Label const &label) const
 
std::string labelsName (dp_index index) const
 
LabelSpacesetTime (dp_index i)
 
LabelSpacesetDomain (dp_index i)
 
LabelSpacesetComplex (dp_index i)
 
LabelSpaceaddAnyTime ()
 
LabelSpaceaddAnyDomain ()
 
LabelSpace deep_copy (ansys::dpf::Client const *const client=nullptr) const
 
void mergeWith (ansys::dpf::LabelSpace const other)
 
- Public Member Functions inherited from ansys::dpf::DpfTypes
virtual bool empty () const
 
virtual std::string describe () const
 
so::API const * callAPI () const
 
bool isOnCommonAPI () const
 
bool getClient (Client &client) const
 
bool hasBeenMovedLocally () const
 
bool isSameObject (DpfTypes const &rhs) const
 

Static Public Member Functions

static LabelSpace emptyLabelSpace ()
 

Detailed Description

Defines an indexation for fields container.

See also
Using collections and labels
Examples
DataApis.cpp, and DataExport.cpp.

Constructor & Destructor Documentation

◆ LabelSpace() [1/5]

ansys::dpf::LabelSpace::LabelSpace ( Client const *const  client)

Create a new LabelSpace for a given client.

Parameters
[in]clientClient instance designating the IP, port and protocol to use.

◆ LabelSpace() [2/5]

ansys::dpf::LabelSpace::LabelSpace ( std::map< Label, dp_int > const &  rhs,
Client const *const  client 
)

Consturct new LabelSpace from labels and values.

Parameters
[in]rhslabels and values with which to construct space.
[in]clientClient instance designating the IP, port and protocol to use.

◆ LabelSpace() [3/5]

ansys::dpf::LabelSpace::LabelSpace ( std::initializer_list< std::pair< const Label, int > >  init,
Client const *const  client 
)

Construct new LabelSpace from pairs of labels and values.

Parameters
[in]initList of label/value pairs.
[in]clientClient instance designating the IP, port and protocol to use.

◆ LabelSpace() [4/5]

ansys::dpf::LabelSpace::LabelSpace ( std::map< Label, dp_int > const &  rhs)

Consturct new LabelSpace from labels and values.

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

◆ LabelSpace() [5/5]

ansys::dpf::LabelSpace::LabelSpace ( std::initializer_list< std::pair< const Label, int > >  init)

Construct new LabelSpace from pairs of labels and values.

Parameters
[in]initList of label/value pairs.

Member Function Documentation

◆ add()

void ansys::dpf::LabelSpace::add ( Label const &  label,
dp_int  value 
)

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

Parameters
[in]labelLabel to add to LabelSpace.
[in]valueValue of label.

◆ addAnyDomain()

LabelSpace & ansys::dpf::LabelSpace::addAnyDomain ( )

Set domain label to -1.

Returns
Reference to labelspace.
See also
labels

◆ addAnyTime()

LabelSpace & ansys::dpf::LabelSpace::addAnyTime ( )

Set time label to -1.

Returns
Reference to labelspace.
See also
labels

◆ at()

dp_int ansys::dpf::LabelSpace::at ( Label const &  label) const
Returns
Value of label within space.
Parameters
[in]labelLabel of which to get value.

◆ deep_copy()

LabelSpace ansys::dpf::LabelSpace::deep_copy ( ansys::dpf::Client const *const  client = nullptr) const

Create a new LabelSpace on a server by copying all the data of this LabelSpace.

Parameters
[in]clientClient instance designating the IP, port and protocol to use.

◆ emptyLabelSpace()

static LabelSpace ansys::dpf::LabelSpace::emptyLabelSpace ( )
static

Create an empty LabelSpace

Returns
Empty LabelSpace

◆ erase()

void ansys::dpf::LabelSpace::erase ( Label const &  label)

Removes label from space.

Parameters
[in]labelLabel to remove.

◆ has()

bool ansys::dpf::LabelSpace::has ( Label const &  label) const
Returns
Indication that label exists within space.
Parameters
[in]labelLabel of which to check existence.

◆ labelsName()

std::string ansys::dpf::LabelSpace::labelsName ( dp_index  index) const
Returns
name of label at given index.
Parameters
[in]indexIndex of the wanted label.

◆ mergeWith()

void ansys::dpf::LabelSpace::mergeWith ( ansys::dpf::LabelSpace const  other)

Inserts all labels and ids of other in this.

◆ set()

void ansys::dpf::LabelSpace::set ( Label const &  label,
dp_int  value 
)

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

Parameters
[in]labelLabel whose value to set.
[in]valueNew value of label.

◆ setComplex()

LabelSpace & ansys::dpf::LabelSpace::setComplex ( dp_index  i)

Set complex label to value.

Returns
Reference to labelspace.
See also
labels
Parameters
[in]iNew value for complex label.

◆ setDomain()

LabelSpace & ansys::dpf::LabelSpace::setDomain ( dp_index  i)

Set domain label to value

Returns
Reference to labelspace.
See also
labels
Parameters
[in]iNew value for domain label.

◆ setTime()

LabelSpace & ansys::dpf::LabelSpace::setTime ( dp_index  i)

Set time label to value.

Returns
Reference to labelspace.
See also
labels
Parameters
[in]iNew value for time label.

◆ size()

dp_int ansys::dpf::LabelSpace::size ( ) const
Returns
Number of labels in space.