1 #ifndef SimTK_SimTKCOMMON_COMMON_H_
2 #define SimTK_SimTKCOMMON_COMMON_H_
104 #ifndef SimTK_DEFAULT_PRECISION
105 # define SimTK_DEFAULT_PRECISION 2
108 #if (SimTK_DEFAULT_PRECISION == 1)
111 #elif (SimTK_DEFAULT_PRECISION == 2)
115 #error ILLEGAL VALUE FOR DEFAULT PRECISION
119 #if defined(__cplusplus)
121 #define SimTK_DEBUG(s) std::printf("DBG: " s)
122 #define SimTK_DEBUG1(s,a1) std::printf("DBG: " s,a1)
123 #define SimTK_DEBUG2(s,a1,a2) std::printf("DBG: " s,a1,a2)
124 #define SimTK_DEBUG3(s,a1,a2,a3) std::printf("DBG: " s,a1,a2,a3)
125 #define SimTK_DEBUG4(s,a1,a2,a3,a4) std::printf("DBG: " s,a1,a2,a3,a4)
128 #define SimTK_DEBUG(s) printf("DBG: " s)
129 #define SimTK_DEBUG1(s,a1) printf("DBG: " s,a1)
130 #define SimTK_DEBUG2(s,a1,a2) printf("DBG: " s,a1,a2)
131 #define SimTK_DEBUG3(s,a1,a2,a3) printf("DBG: " s,a1,a2,a3)
132 #define SimTK_DEBUG4(s,a1,a2,a3,a4) printf("DBG: " s,a1,a2,a3,a4)
135 #define SimTK_DEBUG(s)
136 #define SimTK_DEBUG1(s,a1)
137 #define SimTK_DEBUG2(s,a1,a2)
138 #define SimTK_DEBUG3(s,a1,a2,a3)
139 #define SimTK_DEBUG4(s,a1,a2,a3,a4)
164 #pragma warning(disable:4231)
165 #pragma warning(disable:4251)
166 #pragma warning(disable:4275)
167 #pragma warning(disable:4345)
178 #ifndef HAVE_STRUCT_TIMESPEC
179 #define HAVE_STRUCT_TIMESPEC 1
188 #if defined(SimTK_SimTKCOMMON_BUILDING_SHARED_LIBRARY)
190 #define SimTK_SimTKCOMMON_EXPORT __declspec(dllexport)
192 #pragma warning(disable:4661)
194 #define SimTK_SimTKCOMMON_EXPORT
196 #elif defined(SimTK_SimTKCOMMON_BUILDING_STATIC_LIBRARY) || defined(SimTK_USE_STATIC_LIBRARIES)
197 #define SimTK_SimTKCOMMON_EXPORT
200 #define SimTK_SimTKCOMMON_EXPORT __declspec(dllimport)
202 #define SimTK_SimTKCOMMON_EXPORT
224 #define SimTK_SimTKCOMMON_EXPORT
230 #if defined(__cplusplus)
242 #if defined(__cplusplus)
250 #if defined(__cplusplus)
267 #define SimTK_FORCE_INLINE __forceinline
269 #define SimTK_FORCE_INLINE __attribute__((always_inline)) inline
273 #if defined(_MSC_VER) && _MSC_VER < 1900
274 #define NOEXCEPT_11 throw()
276 #define NOEXCEPT_11 noexcept
282 #if __cplusplus >= 201402L
284 #define DEPRECATED_14(MSG) [[deprecated(MSG)]]
287 #define DEPRECATED_14(MSG) __declspec(deprecated("DEPRECATED: " MSG))
289 #define DEPRECATED_14(MSG) __attribute__((deprecated(MSG)))
292 #define DEPRECATED_14(MSG)
297 #define OVERRIDE_11 override
298 #define FINAL_11 final
312 inline bool canStoreInInt(
unsigned int u) {
return (
unsigned int)(int(u)) == u;}
314 inline bool canStoreInInt(
unsigned long u) {
return (
unsigned long)(int(u)) == u;}
316 inline bool canStoreInInt(
unsigned long long u) {
return (
unsigned long long)(int(u)) == u;}
339 inline bool isSizeInRange(
signed char sz,
signed char mx){
return 0<=sz&&sz<=mx;}
343 inline bool isSizeInRange(
long long sz,
long long mx){
return 0<=sz&&sz<=mx;}
344 inline bool isSizeInRange(
unsigned char sz,
unsigned char mx){
return sz<=mx;}
345 inline bool isSizeInRange(
unsigned short sz,
unsigned short mx){
return sz<=mx;}
347 inline bool isSizeInRange(
unsigned long sz,
unsigned long mx){
return sz<=mx;}
348 inline bool isSizeInRange(
unsigned long long sz,
unsigned long long mx){
return sz<=mx;}
367 inline bool isIndexInRange(
unsigned long long ix,
unsigned long long sz){
return ix<sz;}
426 #define SimTK_DEFINE_UNIQUE_INDEX_TYPE(NAME) \
427 SimTK_DEFINE_AND_EXPORT_UNIQUE_LOCAL_INDEX_TYPE(,,,NAME) \
428 static const NAME Invalid ## NAME;
432 #define SimTK_DEFINE_AND_EXPORT_UNIQUE_INDEX_TYPE(EXPORT,NAME) \
433 SimTK_DEFINE_AND_EXPORT_UNIQUE_LOCAL_INDEX_TYPE(EXPORT,,,NAME) \
434 static const NAME Invalid ## NAME;
437 #define SimTK_DEFINE_UNIQUE_LOCAL_INDEX_TYPE(PARENT,NAME) \
438 SimTK_DEFINE_AND_EXPORT_UNIQUE_LOCAL_INDEX_TYPE(,PARENT,::,NAME)
442 #define SimTK_DEFINE_AND_EXPORT_UNIQUE_LOCAL_INDEX_TYPE(EXPORT,PARENT,SEP,NAME) \
443 class EXPORT NAME { \
446 NAME() : ix(SimTK::InvalidIndex) { } \
447 explicit NAME(int i) : ix(i) {assert(i>=0 || i==SimTK::InvalidIndex);} \
448 explicit NAME(long l): ix((int)l) {assert(SimTK::canStoreInNonnegativeInt(l));} \
449 explicit NAME(long long l): ix((int)l) {assert(SimTK::canStoreInNonnegativeInt(l));} \
450 explicit NAME(unsigned int u) : ix((int)u) {assert(SimTK::canStoreInInt(u));} \
451 explicit NAME(unsigned long ul) : ix((int)ul) {assert(SimTK::canStoreInInt(ul));} \
452 explicit NAME(unsigned long long ul) : ix((int)ul) {assert(SimTK::canStoreInInt(ul));} \
453 operator int() const {return ix;} \
454 bool isValid() const {return ix>=0;} \
455 bool isValidExtended() const {return ix>=-1;} \
456 void invalidate(){clear();} \
457 void clear(){ix=SimTK::InvalidIndex;} \
459 bool operator==(const NAME& other) const {assert(isValidExtended() && isValidExtended(other)); return ix == other.ix; } \
460 bool operator==(int i) const {assert(isValidExtended() && isValidExtended(i)); return ix==i;} \
461 bool operator==(short s) const{assert(isValidExtended() && isValidExtended(s)); return ix==(int)s;} \
462 bool operator==(long l) const {assert(isValidExtended() && isValidExtended(l)); return ix==(int)l;} \
463 bool operator==(long long l) const {assert(isValidExtended() && isValidExtended(l)); return ix==(int)l;} \
464 bool operator==(unsigned int u) const {assert(isValidExtended() && isValid(u)); return ix==(int)u;} \
465 bool operator==(unsigned short us)const {assert(isValidExtended() && isValid(us)); return ix==(int)us;} \
466 bool operator==(unsigned long ul) const {assert(isValidExtended() && isValid(ul)); return ix==(int)ul;} \
467 bool operator==(unsigned long long ul) const {assert(isValidExtended() && isValid(ul)); return ix==(int)ul;} \
468 bool operator!=(int i) const {return !operator==(i);} \
469 bool operator!=(short s) const {return !operator==(s);} \
470 bool operator!=(long l) const {return !operator==(l);} \
471 bool operator!=(long long l) const {return !operator==(l);} \
472 bool operator!=(unsigned int u) const {return !operator==(u);} \
473 bool operator!=(unsigned long ul) const {return !operator==(ul);} \
474 bool operator!=(unsigned long long ul) const {return !operator==(ul);} \
476 bool operator< (int i) const {assert(isValidExtended() && isValidExtended(i)); return ix<i;} \
477 bool operator< (short s) const{assert(isValidExtended() && isValidExtended(s)); return ix<(int)s;} \
478 bool operator< (long l) const {assert(isValidExtended() && isValidExtended(l)); return ix<(int)l;} \
479 bool operator< (long long l) const {assert(isValidExtended() && isValidExtended(l)); return ix<(int)l;} \
480 bool operator< (unsigned int u) const {assert(isValidExtended() && isValid(u)); return ix<(int)u;} \
481 bool operator< (unsigned short us)const {assert(isValidExtended() && isValid(us)); return ix<(int)us;} \
482 bool operator< (unsigned long ul) const {assert(isValidExtended() && isValid(ul)); return ix<(int)ul;} \
483 bool operator< (unsigned long long ul) const {assert(isValidExtended() && isValid(ul)); return ix<(int)ul;} \
484 bool operator>=(int i) const {return !operator<(i);} \
485 bool operator>=(short s) const {return !operator<(s);} \
486 bool operator>=(long l) const {return !operator<(l);} \
487 bool operator>=(long long l) const {return !operator<(l);} \
488 bool operator>=(unsigned int u) const {return !operator<(u);} \
489 bool operator>=(unsigned short us)const {return !operator<(us);} \
490 bool operator>=(unsigned long ul) const {return !operator<(ul);} \
491 bool operator>=(unsigned long long ul) const {return !operator<(ul);} \
493 bool operator> (int i) const {assert(isValidExtended() && isValidExtended(i)); return ix>i;} \
494 bool operator> (short s) const{assert(isValidExtended() && isValidExtended(s)); return ix>(int)s;} \
495 bool operator> (long l) const {assert(isValidExtended() && isValidExtended(l)); return ix>(int)l;} \
496 bool operator> (long long l) const {assert(isValidExtended() && isValidExtended(l)); return ix>(int)l;} \
497 bool operator> (unsigned int u) const {assert(isValidExtended() && isValid(u)); return ix>(int)u;} \
498 bool operator> (unsigned short us)const {assert(isValidExtended() && isValid(us)); return ix>(int)us;} \
499 bool operator> (unsigned long ul) const {assert(isValidExtended() && isValid(ul)); return ix>(int)ul;} \
500 bool operator> (unsigned long long ul) const {assert(isValidExtended() && isValid(ul)); return ix>(int)ul;} \
501 bool operator<=(int i) const {return !operator>(i);} \
502 bool operator<=(short s) const {return !operator>(s);} \
503 bool operator<=(long l) const {return !operator>(l);} \
504 bool operator<=(long long l) const {return !operator>(l);} \
505 bool operator<=(unsigned int u) const {return !operator>(u);} \
506 bool operator<=(unsigned short us)const {return !operator>(us);} \
507 bool operator<=(unsigned long ul) const {return !operator>(ul);} \
508 bool operator<=(unsigned long long ul) const {return !operator>(ul);} \
510 const NAME& operator++() {assert(isValid()); ++ix; return *this;} \
511 NAME operator++(int) {assert(isValid()); ++ix; return NAME(ix-1);} \
512 const NAME& operator--() {assert(isValid()); --ix; return *this;} \
513 NAME operator--(int) {assert(isValid()); --ix; return NAME(ix+1);} \
514 NAME next() const {assert(isValid()); return NAME(ix+1);} \
515 NAME prev() const {assert(isValid()); return NAME(ix-1);} \
517 NAME& operator+=(int i) {assert(isValid() && isValidExtended(ix+i)); ix+=i; return *this;} \
518 NAME& operator-=(int i) {assert(isValid() && isValidExtended(ix-i)); ix-=i; return *this;} \
519 NAME& operator+=(short s){assert(isValid() && SimTK::canStoreInInt(s) && isValidExtended(ix+(int)s)); ix+=(int)s; return *this;} \
520 NAME& operator-=(short s){assert(isValid() && SimTK::canStoreInInt(s) && isValidExtended(ix-(int)s)); ix-=(int)s; return *this;} \
521 NAME& operator+=(long l) {assert(isValid() && SimTK::canStoreInInt(l) && isValidExtended(ix+(int)l)); ix+=(int)l; return *this;} \
522 NAME& operator-=(long l) {assert(isValid() && SimTK::canStoreInInt(l) && isValidExtended(ix-(int)l)); ix-=(int)l; return *this;} \
523 NAME& operator+=(long long l) {assert(isValid() && SimTK::canStoreInInt(l) && isValidExtended(ix+(int)l)); ix+=(int)l; return *this;} \
524 NAME& operator-=(long long l) {assert(isValid() && SimTK::canStoreInInt(l) && isValidExtended(ix-(int)l)); ix-=(int)l; return *this;} \
525 NAME& operator+=(unsigned int u) {assert(isValid()&& SimTK::canStoreInInt(u) && isValid(ix+(int)u)); ix+=(int)u; return *this;} \
526 NAME& operator-=(unsigned int u) {assert(isValid()&& SimTK::canStoreInInt(u) && isValidExtended(ix-(int)u)); ix-=(int)u; return *this;} \
527 NAME& operator+=(unsigned short us){assert(isValid()&& SimTK::canStoreInInt(us) && isValid(ix+(int)us)); ix+=(int)us; return *this;} \
528 NAME& operator-=(unsigned short us){assert(isValid()&& SimTK::canStoreInInt(us) && isValidExtended(ix-(int)us)); ix-=(int)us; return *this;} \
529 NAME& operator+=(unsigned long ul) {assert(isValid()&& SimTK::canStoreInInt(ul) && isValid(ix+(int)ul)); ix+=(int)ul; return *this;} \
530 NAME& operator-=(unsigned long ul) {assert(isValid()&& SimTK::canStoreInInt(ul) && isValidExtended(ix-(int)ul)); ix-=(int)ul; return *this;} \
531 NAME& operator+=(unsigned long long ul) {assert(isValid()&& SimTK::canStoreInInt(ul) && isValid(ix+(int)ul)); ix+=(int)ul; return *this;} \
532 NAME& operator-=(unsigned long long ul) {assert(isValid()&& SimTK::canStoreInInt(ul) && isValidExtended(ix-(int)ul)); ix-=(int)ul; return *this;} \
534 static const NAME& Invalid() {static const NAME invalid; return invalid;} \
535 static bool isValid(int i) {return i>=0;} \
536 static bool isValid(short s){return s>=0;} \
537 static bool isValid(long l) {return SimTK::canStoreInNonnegativeInt(l);} \
538 static bool isValid(long long l) {return SimTK::canStoreInNonnegativeInt(l);} \
539 static bool isValid(unsigned int u) {return SimTK::canStoreInInt(u);} \
540 static bool isValid(unsigned short) {return true;} \
541 static bool isValid(unsigned long ul) {return SimTK::canStoreInInt(ul);} \
542 static bool isValid(unsigned long long ul) {return SimTK::canStoreInInt(ul);} \
543 static bool isValidExtended(int i) {return i>=-1;} \
544 static bool isValidExtended(short s){return s>=-1;} \
545 static bool isValidExtended(long l) {return SimTK::canStoreInInt(l) && l>=-1;} \
546 static bool isValidExtended(long long l) {return SimTK::canStoreInInt(l) && l>=-1;} \
548 typedef int size_type; \
549 typedef int difference_type; \
550 static size_type max_size() {return std::numeric_limits<int>::max();} \
560 #define SimTK_DYNAMIC_CAST_DEBUG dynamic_cast
562 #define SimTK_DYNAMIC_CAST_DEBUG static_cast
568 #define SimTK_DOWNCAST(Derived,Parent) \
569 static bool isA(const Parent& p) \
570 { return dynamic_cast<const Derived*>(&p) != 0; } \
571 static const Derived& downcast(const Parent& p) \
572 { return SimTK_DYNAMIC_CAST_DEBUG<const Derived&>(p); } \
573 static Derived& updDowncast(Parent& p) \
574 { return SimTK_DYNAMIC_CAST_DEBUG<Derived&>(p); } \
575 static Derived& downcast(Parent& p) \
576 { return SimTK_DYNAMIC_CAST_DEBUG<Derived&>(p); }
580 #define SimTK_DOWNCAST2(Derived,Helper,Parent) \
581 static bool isA(const Parent& p) \
582 { return Helper::isA(p); } \
583 static const Derived& downcast(const Parent& p) \
584 { return static_cast<const Derived&>(Helper::downcast(p)); } \
585 static Derived& updDowncast(Parent& p) \
586 { return static_cast<Derived&>(Helper::downcast(p)); } \
587 static Derived& downcast(Parent& p) \
588 { return static_cast<Derived&>(Helper::downcast(p)); }
594 #define SimTK_PIMPL_DOWNCAST(Derived, Parent) \
595 static bool isInstanceOf(const Parent&); \
596 static const Derived& downcast(const Parent&); \
597 static Derived& updDowncast(Parent&)
603 namespace Exception { }
619 template <
int M,
class ELT=Real,
int STRIDE=1>
class Vec;
620 template <
int N,
class ELT=Real,
int STRIDE=1>
class Row;
621 template <
int M,
int N,
class ELT=Real,
int CS=M,
int RS=1>
class Mat;
622 template <
int M,
class ELT=Real,
int RS=1>
class SymMat;
629 assert(l>=0 && ofs>=0);
639 #if !defined(__cpp_lib_three_way_comparison) && !defined SWIG_PYTHON
644 template<
class L,
class R>
inline
647 return !(left == right);
650 template<
class L,
class R>
inline
656 template<
class L,
class R>
inline
659 return !(right < left);
662 template<
class L,
class R>
inline
665 return !(left < right);
719 #define SimTK_SPECIALIZE_INTEGRAL_TYPE(T) \
720 template<> struct IsIntegralType<T> \
721 {typedef TrueType Result; static const bool result = true;}
750 #define SimTK_SPECIALIZE_FLOATING_TYPE(T) \
751 template<> struct IsFloatingType<T> \
752 {typedef TrueType Result; static const bool result = true;}
820 {
return canonicalizeTypeName(std::string(demangledTypeName)); }
833 {
return encodeTypeNameForXML(std::string(niceTypeName)); }
845 {
return decodeXMLTypeName(std::string(xmlTypeName)); }
866 static const char*
name() {
return typeid(T).
name();}
872 static const std::string canonical =
892 #define SimTK_NICETYPENAME_LITERAL(T) \
894 template <> struct NiceTypeName< T > { \
895 static const char* name() { return #T; } \
896 static const std::string& namestr() { \
897 static const std::string str(#T); \
900 static const std::string& xmlstr() { \
901 static const std::string xml = encodeTypeNameForXML(namestr()); \
#define SimTK_SimTKCOMMON_EXPORT
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:224
#define SimTK_NICETYPENAME_LITERAL(T)
This specializes the name of a type to be exactly the text you use to specify it, rather than whateve...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:892
double SimTK_Real
This type is for use in C; in C++ use SimTK::Real instead.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:113
void SimTK_version_SimTKcommon(int *major, int *minor, int *build)
Obtain version information for the currently-loaded SimTKcommon library.
void SimTK_about_SimTKcommon(const char *key, int maxlen, char *value)
Obtain "about" information for the currently-loaded SimTKcommon library.
This class represents a small matrix whose size is known at compile time, containing elements of any ...
Definition: Mat.h:97
This is a fixed-length row vector designed for no-overhead inline computation.
Definition: Row.h:132
This is a small, fixed-size symmetric or Hermitian matrix designed for no-overhead inline computation...
Definition: SymMat.h:87
This is a fixed-length column vector designed for no-overhead inline computation.
Definition: Vec.h:184
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
bool isIndexInRange(char ix, char sz)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:357
std::complex< double > dComplex
An abbreviation for std::complex<double> for consistency with others.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:614
std::complex< Real > Complex
This is the default complex type for SimTK, with precision for the real and imaginary parts set to th...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:610
bool canStoreInNonnegativeInt(bool)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:320
bool isSizeInRange(char sz, char mx)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:338
SimTK_SPECIALIZE_FLOATING_TYPE(float)
std::complex< float > fComplex
An abbreviation for std::complex<float> for consistency with others.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:612
SimTK_SPECIALIZE_INTEGRAL_TYPE(bool)
bool operator>(const L &left, const R &right)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:651
bool operator>=(const L &left, const R &right)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:663
constexpr bool detect64BitPlatform()
Compile-time test: this typedef will be TrueType if this is a 64-bit platform, meaning that the size ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:795
bool operator<=(const L &left, const R &right)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:657
bool isNonnegative(bool)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:373
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:607
Is64BitHelper< Is64BitPlatform >::Result Is64BitPlatformType
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:797
bool operator!=(const L &left, const R &right)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:645
bool canStoreInInt(bool)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:305
static const bool Is64BitPlatform
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:796
static const int InvalidIndex
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:390
FalseType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:689
FalseType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:690
FalseType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:691
TrueType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:692
This is an operator for and-ing compile-time truth types.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:688
This is a special type used for causing invocation of a particular constructor or method overload tha...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:674
This is a compile-time equivalent of "false", used in compile-time condition checking in templatized ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:682
FalseType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:788
TrueType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:786
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:784
Compile-time test: is this one of the built-in "arithmetic" types, meaning an integral or floating ty...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:771
static const bool result
This compile-time constant bool is true if the template type T is one of the integral or floating poi...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:778
OrOpType< typename IsIntegralType< T >::Result, typename IsFloatingType< T >::Result > Result
This typedef is TrueType if the template type T is one of the integral; or floating point types,...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:775
Compile-time type test: is this one of the built-in floating point types?.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:740
static const bool result
This compile-time constant bool is true if the template type T is a floating point type otherwise it ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:746
FalseType Result
This typedef is TrueType if the template type T is a floating point type; otherwise it is FalseType.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:743
Compile-time type test: is this one of the built-in integral types?.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:709
FalseType Result
This typedef is TrueType if the template type T is an integral type; otherwise it is FalseType.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:712
static const bool result
This compile-time constant bool is true if the template type T is an integral type otherwise it is fa...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:715
TrueType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:767
Compile-time type test: is this the void type?.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:758
static const bool result
This compile-time constant bool is true if the template type T is "void" otherwise it is false.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:764
FalseType Result
This typedef is TrueType if the template type T is "void"; otherwise it is FalseType.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:761
Obtain human-readable and XML-usable names for arbitrarily-complicated C++ types.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:862
static const std::string & namestr()
The default implementation of namestr() attempts to return a nicely demangled and canonicalized type ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:871
static const char * name()
The default implementation of name() here returns the raw result from typeid(T).
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:866
std::string canonicalizeTypeName(const std::string &demangledTypeName)
Same, but takes an lvalue reference so has to copy the input.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:819
std::string encodeTypeNameForXML(std::string &&canonicalizedTypeName)
Given a canonicalized type name, produce a modified version that is better-suited to use as an XML at...
std::string decodeXMLTypeName(const std::string &xmlTypeName)
Same, but takes an lvalue reference so has to copy the input.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:844
std::string canonicalizeTypeName(std::string &&demangledTypeName)
Given a compiler-dependent demangled type name string as returned by SimTK::demangle(),...
std::string demangle(const char *name)
Attempt to demangle a type name as returned by typeid.name(), with the result hopefully suitable for ...
std::string encodeTypeNameForXML(const std::string &niceTypeName)
Same, but takes an lvalue reference so has to copy the input.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:832
static const std::string & xmlstr()
The default implementation of xmlstr() takes the output of namestr() and invokes SimTK::encodeTypeNam...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:878
std::string decodeXMLTypeName(std::string &&xmlTypeName)
Given a type name that was encoded for XML by SimTK::encodeTypeNameForXML(), restore it to its canoni...
FalseType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:696
TrueType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:697
TrueType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:698
TrueType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:699
This is an operator for or-ing compile-time truth types.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:695
A convenient struct for anything requiring an offset and length to specify a segment of some larger s...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:626
int length
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:632
int offset
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:633
Segment(int l, int ofs=0)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:628
Segment()
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:627
This is a compile-time equivalent of "true", used in compile-time condition checking in templatized i...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:685
This is a special type used for forcing invocation of a particularly dangerous constructor or method ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:678
FalseType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:703
TrueType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:704
TrueType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:705
FalseType Result
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:706
This is an operator for exclusive or-ing compile-time truth types.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:702