Jamba C++ API
4.0.0
|
Namespaces | |
Collection | |
Concurrent | |
cpp17 | |
Classes | |
class | Cast |
dynamic_cast<U *>(x) does not compile if x is not polymorphic. More... | |
class | Disposable |
Classes who can release resources can implement this interface. More... | |
class | Lerp |
Util class to compute linear interpolation. More... | |
struct | Range |
Defines a range of values. More... | |
Typedefs | |
using | DPLerp = Lerp< double, double, double > |
template<typename X > | |
using | DPLerpX = Lerp< double, X, double > |
template<typename X , typename Y > | |
using | DPLerpXY = Lerp< double, X, Y > |
template<typename Y > | |
using | DPLerpY = Lerp< double, double, Y > |
template<typename T > | |
using | operator_not_eq_t = decltype(std::declval< T const & >() !=std::declval< T const & >()) |
Defines the type for operator!= More... | |
template<typename T > | |
using | operator_write_to_ostream_t = decltype(std::declval< std::ostream & >()<< std::declval< T const & >()) |
Defines the type for operator<< More... | |
using | SPLerp = Lerp< float, float, float > |
template<typename X > | |
using | SPLerpX = Lerp< float, X, float > |
template<typename X , typename Y > | |
using | SPLerpXY = Lerp< float, X, Y > |
template<typename Y > | |
using | SPLerpY = Lerp< float, float, Y > |
template<typename From , typename To > | |
using | static_cast_t = decltype(static_cast< To >(std::declval< From >())) |
Defines the type for static_cast<To>(From) More... | |
Functions | |
template<typename T , typename U > | |
static T | clamp (const U &iValue, const T &iLower, const T &iUpper) |
Make sure that the value remains within its bounds. More... | |
template<typename T , typename U > | |
static T | clampE (const U &value, const T &lower, const T &upper) |
Same as clamp except it will actually fail/assert in debug mode. More... | |
template<typename T , typename U > | |
static T | clampRange (const U &iValue, const T &iFrom, const T &iTo) |
Make sure that the value remains within its bounds. More... | |
template<typename X , typename Y > | |
static DPLerpXY< X, Y > | mapRangeDPXY (X iFromLow, X iFromHigh, Y iToLow, Y iToHigh) |
Convenient shortcut for double precision. More... | |
template<typename X , typename Y > | |
static SPLerpXY< X, Y > | mapRangeSPXY (X iFromLow, X iFromHigh, Y iToLow, Y iToHigh) |
Convenient shortcut for single precision. More... | |
static double | mapValueDP (double iValue, double iFromLow, double iFromHigh, double iToLow, double iToHigh, bool iClamp=true) |
Convenient shortcut for single precision. More... | |
template<typename X > | |
static double | mapValueDPX (X iValue, X iFromLow, X iFromHigh, double iToLow, double iToHigh, bool iClamp=true) |
Convenient shortcut for single precision. More... | |
template<typename X , typename Y > | |
static Y | mapValueDPXY (X iValue, X iFromLow, X iFromHigh, Y iToLow, Y iToHigh, bool iClamp=true) |
Convenient shortcut for single precision. More... | |
template<typename Y > | |
static Y | mapValueDPY (double iValue, double iFromLow, double iFromHigh, Y iToLow, Y iToHigh, bool iClamp=true) |
Convenient shortcut for single precision. More... | |
static float | mapValueSP (float iValue, float iFromLow, float iFromHigh, float iToLow, float iToHigh, bool iClamp=true) |
Convenient shortcut for single precision. More... | |
template<typename X > | |
static float | mapValueSPX (X iValue, X iFromLow, X iFromHigh, float iToLow, float iToHigh, bool iClamp=true) |
Convenient shortcut for single precision. More... | |
template<typename X , typename Y > | |
static Y | mapValueSPXY (X iValue, X iFromLow, X iFromHigh, Y iToLow, Y iToHigh, bool iClamp=true) |
Convenient shortcut for single precision. More... | |
template<typename Y > | |
static Y | mapValueSPY (float iValue, float iFromLow, float iFromHigh, Y iToLow, Y iToHigh, bool iClamp=true) |
Convenient shortcut for single precision. More... | |
template<typename TFloat > | |
std::vector< TFloat > | splitFloats (const std::string &iString, char iDelimiter, bool iSkipEmptyEntries=false) |
Converts the string to a TFloat. More... | |
std::vector< std::string > | splitString (const std::string &iString, char iDelimiter, bool iSkipEmptyEntries) |
Split a string according to a delimiter and returns a vector. More... | |
template<typename Out > | |
void | splitString (const std::string &iString, char iDelimiter, Out oResult, bool iSkipEmptyEntries=false) |
Split a string according to a delimiter and writes the result into Out (can be a vector, array, etc...) More... | |
template<typename TFloat > | |
bool | stringToFloat (const std::string &iString, TFloat &oValue) |
Converts the string to a TFloat (float or double) More... | |
template<typename TFloat > | |
TFloat | stringToFloat (const std::string &iString) |
Converts the string to a TFloat. More... | |
template<typename T > | |
std::string | typeString () |
typeid(T).name() does not account for const or reference. More... | |
Variables | |
template<typename T > | |
constexpr auto | is_operator_not_eq_defined = cpp17::experimental::is_detected_v<operator_not_eq_t, T> |
Allows to detect whether a type defines operator!= at compile time. More... | |
template<typename T > | |
constexpr auto | is_operator_write_to_ostream_defined = cpp17::experimental::is_detected_v<operator_write_to_ostream_t, T> |
Allows to detect whether a type defines ostream << x at compile time. More... | |
template<typename From , typename To > | |
constexpr auto | is_static_cast_defined = cpp17::experimental::is_detected_v<static_cast_t, From, To> |
Allows to detect (at compilation time) whether the call static_cast<To>(from) (where from is of type From ) will compile. More... | |
constexpr auto | mapRangeDP = mapRangeDPXY<double, double> |
template<typename X > | |
constexpr auto | mapRangeDPX = mapRangeDPXY<X, double> |
template<typename Y > | |
constexpr auto | mapRangeDPY = mapRangeDPXY<double, Y> |
constexpr auto | mapRangeSP = mapRangeSPXY<float, float> |
template<typename X > | |
constexpr auto | mapRangeSPX = mapRangeSPXY<X, float> |
template<typename Y > | |
constexpr auto | mapRangeSPY = mapRangeSPXY<float, Y> |
constexpr Steinberg::int32 | MAX_INT32 = 0x7fffffff |
constexpr auto | ZERO_INT32 = static_cast<Steinberg::int32>(0) |
using operator_not_eq_t = decltype(std::declval<T const&>() != std::declval<T const&>()) |
Defines the type for operator!=
using operator_write_to_ostream_t = decltype(std::declval<std::ostream &>() << std::declval<T const&>()) |
Defines the type for operator<<
using static_cast_t = decltype(static_cast<To>(std::declval<From>())) |
Defines the type for static_cast<To>(From)
|
inlinestatic |
Make sure that the value remains within its bounds.
iValue | the value to clamp between iLower and iUpper |
iLower | the lower bound (must be <= iUpper) |
iUpper | the upper bound (must be >= iLower) |
|
inlinestatic |
Same as clamp except it will actually fail/assert in debug mode.
For example can be used to access an array with an index and making sure the index is valid within the array. If it happens in production release then it will no randomly crash the application by accessing random memory.
|
inlinestatic |
Make sure that the value remains within its bounds.
The difference with clamp is that iFrom and iTo do not have to be provided in any specific order.
|
inlinestatic |
Convenient shortcut for double precision.
See Lerp::mapRange
|
inlinestatic |
Convenient shortcut for single precision.
See Lerp::mapRange
|
inlinestatic |
Convenient shortcut for single precision.
See Lerp::mapValue
|
inlinestatic |
Convenient shortcut for single precision.
See Lerp::mapValue
|
inlinestatic |
Convenient shortcut for single precision.
See Lerp::mapValue
|
inlinestatic |
Convenient shortcut for single precision.
See Lerp::mapValue
|
inlinestatic |
Convenient shortcut for single precision.
See Lerp::mapValue
|
inlinestatic |
Convenient shortcut for single precision.
See Lerp::mapValue
|
inlinestatic |
Convenient shortcut for single precision.
See Lerp::mapValue
|
inlinestatic |
Convenient shortcut for single precision.
See Lerp::mapValue
std::vector<TFloat> pongasoft::Utils::splitFloats | ( | const std::string & | iString, |
char | iDelimiter, | ||
bool | iSkipEmptyEntries = false |
||
) |
Converts the string to a TFloat.
std::vector< std::string > splitString | ( | const std::string & | iString, |
char | iDelimiter, | ||
bool | iSkipEmptyEntries | ||
) |
Split a string according to a delimiter and returns a vector.
iString | the string to split |
iDelimiter | the delimiter |
iSkipEmptyEntries | whether to include or not empty entries |
void pongasoft::Utils::splitString | ( | const std::string & | iString, |
char | iDelimiter, | ||
Out | oResult, | ||
bool | iSkipEmptyEntries = false |
||
) |
Split a string according to a delimiter and writes the result into Out (can be a vector, array, etc...)
iString | the string to split |
iDelimiter | the delimiter |
oResult | the result |
iSkipEmptyEntries | whether to include or not empty entries |
bool pongasoft::Utils::stringToFloat | ( | const std::string & | iString, |
TFloat & | oValue | ||
) |
Converts the string to a TFloat (float or double)
TFloat pongasoft::Utils::stringToFloat | ( | const std::string & | iString | ) |
Converts the string to a TFloat.
std::string pongasoft::Utils::typeString | ( | ) |
typeid(T).name()
does not account for const
or reference.
This function adds the const
and &
qualifier when necessary
constexpr auto is_operator_not_eq_defined = cpp17::experimental::is_detected_v<operator_not_eq_t, T> |
Allows to detect whether a type defines operator!=
at compile time.
Example:
constexpr auto is_operator_write_to_ostream_defined = cpp17::experimental::is_detected_v<operator_write_to_ostream_t, T> |
Allows to detect whether a type defines ostream << x
at compile time.
Example:
constexpr auto is_static_cast_defined = cpp17::experimental::is_detected_v<static_cast_t, From, To> |
Allows to detect (at compilation time) whether the call static_cast<To>(from)
(where from
is of type From
) will compile.
Example:
constexpr auto mapRangeDP = mapRangeDPXY<double, double> |
constexpr auto mapRangeDPX = mapRangeDPXY<X, double> |
constexpr auto mapRangeDPY = mapRangeDPXY<double, Y> |
constexpr auto mapRangeSP = mapRangeSPXY<float, float> |
constexpr auto mapRangeSPX = mapRangeSPXY<X, float> |
constexpr auto mapRangeSPY = mapRangeSPXY<float, Y> |
constexpr Steinberg::int32 MAX_INT32 = 0x7fffffff |
constexpr auto ZERO_INT32 = static_cast<Steinberg::int32>(0) |