C++ main module for stochmagnet Package  1.0
Classes | Functions | Variables
core_functions Namespace Reference

Classes

struct  is_complex
 
struct  is_complex< std::complex< T > >
 

Functions

template<class T >
tString pointerToString (const T *ptr)
 return the pointer of the class as a string More...
 
template<typename T >
tBoolean areEquals (const T &e1, const T &e2)
 tests if two elements are equals More...
 
template<>
tBoolean areEquals (const tReal &e1, const tReal &e2)
 tests if two string are equals More...
 
template<>
tBoolean areEquals (const tComplex &e1, const tComplex &e2)
 tests if two string are equals More...
 
template<>
tBoolean areEquals (const tString &e1, const tString &e2)
 tests if two string are equals More...
 
template<typename T , std::enable_if_t< std::is_integral_v< T >> * = nullptr>
tString toString (const T &v, const tUCInt &d)
 
template<typename T , std::enable_if_t< std::is_arithmetic_v< T >> * = nullptr>
tString toString (const T &v)
 
tString booleanToString (const tBoolean &v)
 
tStringltrim (tString &s)
 remove all the empty characters at the beginning of the string More...
 
tStringrtrim (tString &s)
 remove all the empty characters at the end of the string More...
 
tStringtrim (tString &s)
 remove all the empty characters at the begining and end of the string More...
 
void replaceAll (const tString &word, const tString &rWord, tString &str)
 replace all instnce of word by replace word in string More...
 
void toLower (tString &s)
 turn a string to lower value More...
 
void toUpper (tString &s)
 turn a string to lower value More...
 
void tokenize (tString &str, const tString &delim, std::vector< tString > words)
 tokenize More...
 
template<typename T >
requires core_functions::isArithmeticType< T > const T & min (const T &a, const T &b)
 min function More...
 
template<typename T >
requires core_functions::isArithmeticType< T > const T & max (const T &a, const T &b)
 max function More...
 
template<typename T >
requires core_functions::isRealType< T > tBoolean isNAN (const T &s)
 return true if the argument is an integer number More...
 
tBoolean isInteger (const tString &s)
 return true if the argument is an integer number More...
 
tBoolean isNumeric (const tString &s)
 return true if the argument is an integer number More...
 
tBoolean isString (const tString &s)
 return true if the argument is a string More...
 
template<typename T >
void parse (const tString &s, T &v)
 parse the string More...
 
template<>
void parse (const tString &s, tBoolean &v)
 parse the string More...
 
template<typename T , size_t D>
tString toString (const std::array< T, D > &a)
 rretru the array to string More...
 
template<typename T >
tString toString (const std::valarray< T > &a)
 rretru the array to string More...
 
template<typename Q >
const std::pair< Q, Q > & complexMultiply (const std::pair< Q, Q > &alpha, std::pair< Q, Q > &beta)
 
template<typename Q >
const std::pair< Q, Q > & complexAdd (const std::pair< Q, Q > &alpha, std::pair< Q, Q > &beta)
 

Variables

template<typename T >
concept isComplexType
 
template<typename T >
concept isArithmeticType
 
template<typename T >
concept isOrderedType
 
template<typename T >
concept isStringType
 
template<typename T >
concept isRealType
 
template<typename T >
concept isIntegerType
 
template<typename T >
concept isSignedIntegerType
 
template<typename T >
concept isUnsignedIntegerType
 
template<class Base , class Derived >
concept isBaseOf = std::is_base_of_v<Base, Derived>
 
template<class T >
concept isArray = std::is_array<T>()
 
template<class T >
concept isBoundedArray = std::is_bounded_array<T>::value
 
template<class T >
concept isUnboundedArray = std::is_unbounded_array<T>::value
 
template<class T >
concept isDoubleArray = std::is_pointer_v<T**>
 
template<class T >
concept isPointer = std::is_pointer_v<T>
 
template<class T >
concept iNotNullPointer = not std::is_pointer<std::nullptr_t>::value
 
template<class T , class Q >
concept isSameType = std::is_same<T,Q>::value
 

Function Documentation

◆ areEquals() [1/4]

template<typename T >
tBoolean core_functions::areEquals ( const T &  e1,
const T &  e2 
)
inline

tests if two elements are equals

Parameters
[in]e1element to compare
[in]e2element to compare
Returns
true if the two string are equals

◆ areEquals() [2/4]

template<>
tBoolean core_functions::areEquals ( const tComplex e1,
const tComplex e2 
)
inline

tests if two string are equals

Parameters
[in]e1element to compare
[in]e2element to compare
Returns
true if the two string are equals

It overrides the generic template areEquals(const T&,const T&)

◆ areEquals() [3/4]

template<>
tBoolean core_functions::areEquals ( const tReal e1,
const tReal e2 
)
inline

tests if two string are equals

Parameters
[in]e1element to compare
[in]e2element to compare
Returns
true if the two string are equals

It overrides the generic template areEquals(const T&,const T&)

◆ areEquals() [4/4]

template<>
tBoolean core_functions::areEquals ( const tString e1,
const tString e2 
)
inline

tests if two string are equals

Parameters
[in]e1element to compare
[in]e2element to compare
Returns
true if the two string are equals

It overrides the generic template areEquals(const T&,const T&)

◆ booleanToString()

tString core_functions::booleanToString ( const tBoolean v)
inline

brief tranform the numeric type name value v to string

Parameters
[in]vvalue to turn into string

Referenced by SM_Test::validate().

Here is the caller graph for this function:

◆ complexAdd()

template<typename Q >
const std::pair<Q,Q>& core_functions::complexAdd ( const std::pair< Q, Q > &  alpha,
std::pair< Q, Q > &  beta 
)
inline

◆ complexMultiply()

template<typename Q >
const std::pair<Q,Q>& core_functions::complexMultiply ( const std::pair< Q, Q > &  alpha,
std::pair< Q, Q > &  beta 
)
inline

◆ isInteger()

tBoolean core_functions::isInteger ( const tString s)
inline

return true if the argument is an integer number

Parameters
[in]sstring to test
Returns
true if the argument is an integer

Referenced by isString().

Here is the caller graph for this function:

◆ isNAN()

template<typename T >
requires core_functions::isRealType<T> tBoolean core_functions::isNAN ( const T &  s)
inline

return true if the argument is an integer number

Parameters
[in]sstring to test
Returns
true if the argument is an integer

Referenced by SM_Test::testDerivative(), and SM_Test::validate().

Here is the caller graph for this function:

◆ isNumeric()

tBoolean core_functions::isNumeric ( const tString s)
inline

return true if the argument is an integer number

Parameters
[in]sstring to test
Returns
true if the argument is an integer

Referenced by isString().

Here is the caller graph for this function:

◆ isString()

tBoolean core_functions::isString ( const tString s)
inline

return true if the argument is a string

Parameters
[in]sstring to test
Returns
true if the argument is a string

References isInteger(), and isNumeric().

Here is the call graph for this function:

◆ ltrim()

tString& core_functions::ltrim ( tString s)
inline

remove all the empty characters at the beginning of the string

Parameters
[in]sstring to remove blank characters
Returns
the new string without blanck characters

Referenced by trim().

Here is the caller graph for this function:

◆ max()

template<typename T >
requires core_functions::isArithmeticType<T> const T& core_functions::max ( const T &  a,
const T &  b 
)
inline

◆ min()

template<typename T >
requires core_functions::isArithmeticType<T> const T& core_functions::min ( const T &  a,
const T &  b 
)
inline

◆ parse() [1/2]

template<typename T >
void core_functions::parse ( const tString s,
T &  v 
)
inline

parse the string

Parameters
[in]sstring to parse
[out]v: the numeric value of V

Referenced by CORE_OptionsReader::ReadArray(), and CORE_OptionsReader::ReadVector().

Here is the caller graph for this function:

◆ parse() [2/2]

template<>
void core_functions::parse ( const tString s,
tBoolean v 
)
inline

parse the string

Parameters
[in]sstring to parse
[out]v: the boolean value v

References toLower(), and tString.

Here is the call graph for this function:

◆ pointerToString()

template<class T >
tString core_functions::pointerToString ( const T *  ptr)
inline

return the pointer of the class as a string

Returns
the pointer of the class as a string

Referenced by CORE_Object::getIdentityString(), CORE_Object::getPointerString(), CORE_MemoryStack< T >::registerClass(), and CORE_MemoryStack< T >::unregisterClass().

Here is the caller graph for this function:

◆ replaceAll()

void core_functions::replaceAll ( const tString word,
const tString rWord,
tString str 
)
inline

replace all instnce of word by replace word in string

Parameters
[in]wordword to replace
[in]rWordreplace word
[in]strstring to replace
Returns
the new string after replacing words

References tIndex.

◆ rtrim()

tString& core_functions::rtrim ( tString s)
inline

remove all the empty characters at the end of the string

Parameters
[in]sstring to remove blank characters
Returns
the new string without blanck characters

Referenced by trim().

Here is the caller graph for this function:

◆ tokenize()

void core_functions::tokenize ( tString str,
const tString delim,
std::vector< tString words 
)
inline

tokenize

Parameters
[in]stringstring to tokenize
[in]delim: separator
[out]wordsGet all the words separed by a separator

References tString.

◆ toLower()

void core_functions::toLower ( tString s)
inline

turn a string to lower value

Parameters
[in,out]sstring to transform

Referenced by CORE_IO::CopyFiles(), CORE_IO::GetFiles(), parse(), and CORE_OptionsReader::ReadBoolean().

Here is the caller graph for this function:

◆ toString() [1/4]

template<typename T , size_t D>
tString core_functions::toString ( const std::array< T, D > &  a)
inline

rretru the array to string

◆ toString() [2/4]

template<typename T >
tString core_functions::toString ( const std::valarray< T > &  a)
inline

rretru the array to string

◆ toString() [3/4]

template<typename T , std::enable_if_t< std::is_arithmetic_v< T >> * = nullptr>
tString core_functions::toString ( const T &  v)
inline

brief tranform the numeric type name value v to string

Parameters
[in]vvalue to turn into string

◆ toString() [4/4]

template<typename T , std::enable_if_t< std::is_integral_v< T >> * = nullptr>
tString core_functions::toString ( const T &  v,
const tUCInt d 
)
inline

brief tranform the numeric type name value v to string

Parameters
[in]vvalue to turn into string

References tString, and tUCInt.

◆ toUpper()

void core_functions::toUpper ( tString s)
inline

turn a string to lower value

Parameters
[in,out]sstring to transform

References tString.

◆ trim()

tString& core_functions::trim ( tString s)
inline

remove all the empty characters at the begining and end of the string

Parameters
[in]sstring to remove blank characters
Returns
the new string without blanck characters

References ltrim(), and rtrim().

Referenced by CORE_Run::executeRun(), CORE_OptionsReader::ReadBoolean(), CORE_OptionsReader::ReadOptions(), CORE_OptionsReader::ReadOptionValue(), and CORE_OptionsReader::RegisterOption().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ iNotNullPointer

template<class T >
concept core_functions::iNotNullPointer = not std::is_pointer<std::nullptr_t>::value

◆ isArithmeticType

template<typename T >
concept core_functions::isArithmeticType
Initial value:
=
(std::is_arithmetic_v<T> || isComplexType<T> )

◆ isArray

template<class T >
concept core_functions::isArray = std::is_array<T>()

◆ isBaseOf

template<class Base , class Derived >
concept core_functions::isBaseOf = std::is_base_of_v<Base, Derived>

◆ isBoundedArray

template<class T >
concept core_functions::isBoundedArray = std::is_bounded_array<T>::value

◆ isComplexType

template<typename T >
concept core_functions::isComplexType
Initial value:
=
( std::floating_point<T> || is_complex<T>::value)

◆ isDoubleArray

template<class T >
concept core_functions::isDoubleArray = std::is_pointer_v<T**>

◆ isIntegerType

template<typename T >
concept core_functions::isIntegerType
Initial value:
=
(std::is_integral_v<T>)

◆ isOrderedType

template<typename T >
concept core_functions::isOrderedType
Initial value:
=
(std::totally_ordered<T>)

◆ isPointer

template<class T >
concept core_functions::isPointer = std::is_pointer_v<T>

◆ isRealType

template<typename T >
concept core_functions::isRealType
Initial value:
=
(std::is_floating_point_v<T>)

◆ isSameType

template<class T , class Q >
concept core_functions::isSameType = std::is_same<T,Q>::value

◆ isSignedIntegerType

template<typename T >
concept core_functions::isSignedIntegerType
Initial value:
=
(std::is_integral_v<T>) && (std::is_signed_v<T>)

◆ isStringType

template<typename T >
concept core_functions::isStringType
Initial value:
=
(std::is_constructible<std::string,T>::value)

◆ isUnboundedArray

template<class T >
concept core_functions::isUnboundedArray = std::is_unbounded_array<T>::value

◆ isUnsignedIntegerType

template<typename T >
concept core_functions::isUnsignedIntegerType
Initial value:
=
(std::is_integral_v<T>) && (!std::is_signed_v<T>)