- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# D:/Programmation/Sources/Tensor2/Utils/include/frost_utils_types.h

Go to the documentation of this file.

    00001 /* ###################################### */
    00002 /* ###     Frost Engine, by Kalith    ### */
    00003 /* ###################################### */
    00004 /*              Types header              */
    00005 /*                                        */
    00006 /*                                        */
    00007
    00008 #ifndef FROST_UTILS_TYPES_H
    00009 #define FROST_UTILS_TYPES_H
    00010
    00011 #include "frost_utils_config.h"
    00012
    00013 #ifdef MSVC
    00014     // Note : Microsoft's Visual C++ doesn't include the round function.
    00015     // Definition of this function is in frost_utils_math.cpp.
    00016     long round( double x );
    00017 #else
    00018     // Forward declaration to avoid including <cmath>.
    00019     // Used by some template functions.
    00020     #ifdef FROST_LINUX
    00021     extern "C" double round( double x ) throw();
    00022     #else
    00023     extern "C" double __cdecl round( double x );
    00024     #endif
    00025 #endif
    00026
    00027 namespace Frost
    00028 {
    00029     template<class T>               class s_str_t;
    00030     template<class T>               class s_bool_t;
    00031     template<class T>               class s_int_t;
    00032     template<class T>               class s_uint_t;
    00033     template<class T>               class s_float_t;
    00034     template<class T, class C>      class s_ctnr_t;
    00035     template<class T>               class s_ctnr;
    00036     template<class T, uint N>       class s_array;
    00037     template<class T, class N>      class s_pair;
    00038     template<class T>               class s_range;
    00039     template<class Key, class Data> class s_map;
    00040     template<class Key, class Data> class s_multimap;
    00041                                     class s_nullptr;
    00042     template<class T>               class s_ptr;
    00043     template<class T>               class s_refptr;
    00044     template<class T>               class s_wptr;
    00045
    00046     /// Stores various informations about a type.
    00047     template<class T>
    00048     class TypeTraits
    00049     {
    00050     public :
    00051         typedef T         Type;
    00052         typedef T         BaseType;
    00053         typedef T         FrostType;
    00054         typedef T&        RefType;
    00055         typedef T const & CRefType;
    00056         typedef T*        PointerType;
    00057
    00058         static inline CRefType GetValue(CRefType m) { return m; }
    00059     };
    00060
    00061     /// Allows explicit string conversion and operator overloading.
    00062     /** This class is used for explicit constructors and +, += and <<
    00063     *   operators. It is specialized for most commonly used string
    00064     *   types : s_str and s_ustr.<br>
    00065     *   \note T : character type to convert to
    00066     *         N : type to convert from
    00067     */
    00068     template<class T, class N> class StringConverter;
    00069 }
    00070
    00071 #include "frost_utils_bool.h"
    00072 #include "frost_utils_int.h"
    00073 #include "frost_utils_uint.h"
    00074 #include "frost_utils_float.h"
    00075 #include "frost_utils_str.h"
    00076 #include "frost_utils_str_conversion.h"
    00077
    00078 namespace Frost
    00079 {
    00080     typedef s_int_t<char>      s_char;
    00081     typedef s_int_t<short>     s_short;
    00082     typedef s_int_t<int>       s_int;
    00083     typedef s_int_t<long>      s_long;
    00084     typedef s_int_t<long long> s_llong;
    00085     typedef s_int_t<ptrdiff_t> s_ptrdiff;
    00086
    00087     typedef s_uint_t<uchar>              s_uchar;
    00088     typedef s_uint_t<ushort>             s_ushort;
    00089     typedef s_uint_t<uint>               s_uint;
    00090     typedef s_uint_t<ulong>              s_ulong;
    00091     typedef s_uint_t<unsigned long long> s_ullong;
    00092
    00093     typedef s_float_t<float>       s_float;
    00094     typedef s_float_t<double>      s_double;
    00095     typedef s_float_t<long double> s_ldouble;
    00096
    00097     typedef s_str_t<string_element> s_str;
    00098     typedef s_str_t<uint>           s_ustr;
    00099
    00100     long StringToInt(const s_str& s);
    00101     long StringToInt(const s_ustr& s);
    00102     ulong StringToUInt(const s_str& s);
    00103     ulong StringToUInt(const s_ustr& s);
    00104     double StringToFloat(const s_str& s);
    00105     double StringToFloat(const s_ustr& s);
    00106 }
    00107
    00108 #include "frost_utils_nullptr.h"
    00109 #include "frost_utils_ptr.h"
    00110 #include "frost_utils_refptr.h"
    00111 #include "frost_utils_wptr.h"
    00112 #include "frost_utils_ctnr.h"
    00113 #include "frost_utils_array.h"
    00114 #include "frost_utils_map.h"
    00115 #include "frost_utils_multimap.h"
    00116 #include "frost_utils_makepair.h"
    00117
    00118 #endif