tfel
Loading...
Searching...
No Matches
tfel Namespace Reference

the namespace tfel encloses all the TFEL project. This namespace is empty. More...

Namespaces

namespace  material
 This namespace contains classes and functions related to mechanics and material description. The functionalities included in this namespace includes:
namespace  math
 This namespace contains various classes and functions défining mathematical objects and numerical algorithms.

Classes

struct  PhysicalConstants

Typedefs

using ContractViolationHandler = void (*)(const char* const)
 type of the functions called on a contract violation

Functions

TFELCONFIG_VISIBILITY_EXPORT std::string getInstallPath ()
TFELCONFIG_VISIBILITY_EXPORT std::string getTFELExecutableName (const std::string &)
TFELCONFIG_VISIBILITY_EXPORT std::string getTFELConfigExecutableName ()
TFELCONFIG_VISIBILITY_EXPORT std::string getLibraryInstallName (const std::string &)
TFELEXCEPTION_VISIBILITY_EXPORT TFEL_HOST void reportContractViolation (const char *const)
 report a contract violation
TFELEXCEPTION_VISIBILITY_EXPORT TFEL_HOST ContractViolationHandler setContractViolationHandler (const ContractViolationHandler)
 set the function called by reportContractViolation before aborting the program. This function is meant to throw an exception, for instance in the python bindings. If it returns, the program is aborted.
template<typename Exception = std::runtime_error>
TFEL_VISIBILITY_LOCAL TFEL_INLINE void raise ()
 a small wrapper used to build the exception outside the throw statement. As most exception's classes constructors may throw, this avoids undefined behaviour as reported by the cert-err60-cpp warning of clang-tidy (thrown exception type is not nothrow copy constructible).
template<typename Exception = std::runtime_error, typename... Args>
TFEL_VISIBILITY_LOCAL TFEL_INLINE void raise (Args &&...)
 a small wrapper used to build the exception outside the throw statement. As most exception's classes constructors may throw, this avoids undefined behaviour as reported by the cert-err60-cpp warning of clang-tidy (thrown exception type is not nothrow copy constructible).
template<typename Exception = std::runtime_error>
TFEL_VISIBILITY_LOCAL TFEL_INLINE void raise_if (const bool)
 raise an exception if the first argument is true.
template<typename Exception = std::runtime_error, typename... Args>
TFEL_VISIBILITY_LOCAL TFEL_INLINE void raise_if (const bool, Args &&...)
 raise an exception if the first argument is true.
template<typename Exception>
void raise ()
 a small wrapper used to build the exception outside the throw statement. As most exception's classes constructors may throw, this avoids undefined behaviour as reported by the cert-err60-cpp warning of clang-tidy (thrown exception type is not nothrow copy constructible).
template<typename Exception, typename... Args>
void raise (Args &&... a)
template<typename Exception>
void raise_if (const bool c)
 raise an exception if the first argument is true.
template<typename Exception, typename... Args>
void raise_if (const bool c, Args &&... a)

Detailed Description

the namespace tfel encloses all the TFEL project. This namespace is empty.

Function Documentation

◆ getTFELExecutableName()

TFELCONFIG_VISIBILITY_EXPORT std::string tfel::getTFELExecutableName ( const std::string & )
Returns
the name of an executable generated by the TFEL project, taking into account the operating system and an eventual suffix (as defined by the TFEL_VERSION_FLAVOUR and the TFEL_APPEND_VERSION options that can be passed to cmake for details).
Parameters
[in]nbase name of the executable (for example, tfel-config, mfront).

◆ raise() [1/3]

template<typename Exception = std::runtime_error>
TFEL_VISIBILITY_LOCAL TFEL_INLINE void tfel::raise ( )

a small wrapper used to build the exception outside the throw statement. As most exception's classes constructors may throw, this avoids undefined behaviour as reported by the cert-err60-cpp warning of clang-tidy (thrown exception type is not nothrow copy constructible).

Template Parameters
Exceptiontype of the exception to be thrown.

◆ raise() [2/3]

template<typename Exception>
void tfel::raise ( )

a small wrapper used to build the exception outside the throw statement. As most exception's classes constructors may throw, this avoids undefined behaviour as reported by the cert-err60-cpp warning of clang-tidy (thrown exception type is not nothrow copy constructible).

Template Parameters
Exceptiontype of the exception to be thrown.

◆ raise() [3/3]

template<typename Exception = std::runtime_error, typename... Args>
TFEL_VISIBILITY_LOCAL TFEL_INLINE void tfel::raise ( Args && ...)

a small wrapper used to build the exception outside the throw statement. As most exception's classes constructors may throw, this avoids undefined behaviour as reported by the cert-err60-cpp warning of clang-tidy (thrown exception type is not nothrow copy constructible).

Template Parameters
Exceptiontype of the exception to be thrown.
Argstype of the arguments passed to the exception' constructor.
Parameters
[in]aarguments passed to the exception' constructor.

◆ raise_if() [1/3]

template<typename Exception>
void tfel::raise_if ( const bool c)

raise an exception if the first argument is true.

Template Parameters
Exceptiontype of the exception to be thrown.
Parameters
[in]bcondition to be checked. If true, an exception is thrown.

◆ raise_if() [2/3]

template<typename Exception = std::runtime_error>
TFEL_VISIBILITY_LOCAL TFEL_INLINE void tfel::raise_if ( const bool c)

raise an exception if the first argument is true.

Template Parameters
Exceptiontype of the exception to be thrown.
Parameters
[in]bcondition to be checked. If true, an exception is thrown.

◆ raise_if() [3/3]

template<typename Exception = std::runtime_error, typename... Args>
TFEL_VISIBILITY_LOCAL TFEL_INLINE void tfel::raise_if ( const bool ,
Args && ... )

raise an exception if the first argument is true.

Template Parameters
Exceptiontype of the exception to be thrown.
Argstype of the arguments passed to the exception' constructor.
Parameters
[in]bcondition to be checked. If true, an exception is thrown.
[in]aarguments passed to the exception' constructor.

◆ reportContractViolation()

TFELEXCEPTION_VISIBILITY_EXPORT TFEL_HOST void tfel::reportContractViolation ( const char * const )

report a contract violation

Parameters
[in]msgmessage

◆ setContractViolationHandler()

TFELEXCEPTION_VISIBILITY_EXPORT TFEL_HOST ContractViolationHandler tfel::setContractViolationHandler ( const ContractViolationHandler )

set the function called by reportContractViolation before aborting the program. This function is meant to throw an exception, for instance in the python bindings. If it returns, the program is aborted.

Returns
the previous handler
Parameters
[in]hnew handler (nullptr restores the default behaviour)