Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::UnitSystem Struct Reference

Last update: 10.07.2023

#include <dpf_api_base.h>

Public Member Functions

 UnitSystem (std::string const &name, int id)
 
 UnitSystem (std::string const &name, std::string const &unit_names)
 
 operator std::string () const
 
const char * c_str () const
 
dp_id getId () const
 
std::string getUnitNames () const
 
bool operator== (UnitSystem const &rhs) const
 

Detailed Description

System of measurement units.

Constructor & Destructor Documentation

◆ UnitSystem() [1/2]

ansys::dpf::UnitSystem::UnitSystem ( std::string const &  name,
int  id 
)
explicit

Create new unit system.

Parameters
[in]nameName of unit system.
[in]idCommon unit system identifier used by Ansys.

◆ UnitSystem() [2/2]

ansys::dpf::UnitSystem::UnitSystem ( std::string const &  name,
std::string const &  unit_names 
)
explicit

Creates a new custom unit system from its base unit strings

Parameters
[in]nameName of unit system
[in]unit_namessemicolon-separated list of base units (Length, Mass, Time, Temperature, Electric Charge and Angle)

Member Function Documentation

◆ c_str()

const char * ansys::dpf::UnitSystem::c_str ( ) const

Gets name of unit system.

Returns
Name of unit system.

◆ getId()

dp_id ansys::dpf::UnitSystem::getId ( ) const

Gets identifer of unit system.

Returns
Id of unit system.

◆ getUnitNames()

std::string ansys::dpf::UnitSystem::getUnitNames ( ) const

Gets unit_names of unit system (if it is custom).

Returns
unit_names string of unit system (if it is custom).

◆ operator std::string()

ansys::dpf::UnitSystem::operator std::string ( ) const

Name of unit system.