Skip to main content
Define a DOM (Document-Object-Model) tree. Inherits from:

Members

Friends

Public functions

Function DataTree

Return type:

Function DataTree

Parameters:
  • Client const *const client: [in] Client instance designating the IP, port and protocol to use.
Return type:

Function ~DataTree

Return type:

Function DataTree

Parameters:
  • DataTree const &
Return type:

Function DataTree

Parameters:
  • DataTree &&
Return type:

Function operator=

Parameters:
  • DataTree const &
Return type: DataTree &

Function operator=

Parameters:
  • DataTree &&
Return type: DataTree &

Function fillFromJson

Fill this data tree with the content of a json file generated by another tree (See DataTree::writeToJson). Parameters:
  • std::istream const & stream
Return type: void

Function fillFromTxt

Fill this data tree with the content of a txt file generated by another tree (See DataTree::writeToTxt). Parameters:
  • std::istream const & stream
Return type: void

Function writeToTxt

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 & stream
Return type: void

Function writeToJson

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 & stream
Return type: void

Function getAvailableAttributeNames

Returns: the list of attributes names available (without recursivity in the subtrees). Return type: std::vector< std::string >

Function getAvailableSubTreeNames

Returns: the list of first rank substree names available (without recursivity in the subtrees). Return type: std::vector< std::string >

Function getSubByName

Returns: a subtree by its name (return an empty substree if it doesn’t exist). Parameters:
  • std::string const & name
Return type: const DataTree

Function getIntAttribute

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 & name
  • int default_value = 0
Return type: int

Function tryGetIntAttribute

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 & name
  • int & value
Return type: bool

Function getBoolAttribute

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 & name
  • bool default_value = false
Return type: bool

Function tryGetBoolAttribute

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 & name
  • bool & value
Return type: bool

Function getUnsignedIntAttribute

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 & name
  • unsigned int default_value = 0
Return type: unsigned int

Function tryGetUnsignedIntAttribute

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 & name
  • unsigned int & value
Return type: bool

Function getDoubleAttribute

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 & name
  • double default_value = 0.0
Return type: double

Function tryGetDoubleAttribute

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 & name
  • double & value
Return type: bool

Function getStringAttribute

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 & name
  • std::string = ""
Return type: std::string

Function tryGetStringAttribute

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 & name
  • std::string & value
Return type: bool

Function getVectIntAttribute

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 & name
  • std::vector< int > default_value = {}
Return type: std::vector< int >

Function tryGetVectIntAttribute

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 & name
  • std::vector< int > & value
Return type: bool

Function getVectDoubleAttribute

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 & name
  • std::vector< double > default_value = {}
Return type: std::vector< double >

Function tryGetVectDoubleAttribute

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 & name
  • std::vector< double > & value
Return type: bool

Function getVectStringAttribute

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 & name
  • std::vector< std::string > default_value = {}
Return type: std::vector< std::string >

Function tryGetVectStringAttribute

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 & name
  • std::vector< std::string > & value
Return type: bool

Function makeIntAttribute

create or replace an attribute. Parameters:
  • std::string const & name
  • int value
Return type: void

Function makeBoolAttribute

create or replace an attribute. Parameters:
  • std::string const & name
  • bool value
Return type: void

Function makeUnsignedIntAttribute

create or replace an attribute. Parameters:
  • std::string const & name
  • unsigned int value
Return type: void

Function makeDoubleAttribute

create or replace an attribute. Parameters:
  • std::string const & name
  • double value
Return type: void

Function makeStringAttribute

create or replace an attribute. Parameters:
  • std::string const & name
  • std::string const & value
Return type: void

Function makeVectIntAttribute

create or replace an attribute. Parameters:
  • std::string const & name
  • std::vector< int > const & value
Return type: void

Function makeVectDoubleAttribute

create or replace an attribute. Parameters:
  • std::string const & name
  • std::vector< double > const & value
Return type: void

Function makeVectStringAttribute

create or replace an attribute. Parameters:
  • std::string const & name
  • std::vector< std::string > const & value
Return type: void

Function makeSub

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 & name
Return type: DataTree

Function makeSubTreeAttribute

Parameters:
  • std::string const & name
  • DataTree const *const sub_tree
Return type: void

Function hasAttribute

Returns: true if an attribute exists (accepts sub attributes by adding ”/”, example attribute_name=“sub_name/attrib_name”). Parameters:
  • std::string const & attribute_name
Return type: bool

Function hasSub

Returns: true if a subtree exists. Parameters:
  • std::string const & attribute_name
Return type: bool

Function deep_copy

Make a deep copy on a given client. Parameters: Return type: DataTree

Public static functions

Function emptyDataTree

Create an empty DataTree. Returns: Empty DataTree. Return type: DataTree