Warning, file /sdk/codevis/thirdparty/soci/include/private/soci-exchange-cast.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 // 0002 // Copyright (C) 2015 Vadim Zeitlin 0003 // Distributed under the Boost Software License, Version 1.0. 0004 // (See accompanying file LICENSE_1_0.txt or copy at 0005 // http://www.boost.org/LICENSE_1_0.txt) 0006 // 0007 0008 #ifndef SOCI_EXCHANGE_CAST_H_INCLUDED 0009 #define SOCI_EXCHANGE_CAST_H_INCLUDED 0010 0011 #include "soci/soci-backend.h" 0012 #include "soci/type-wrappers.h" 0013 0014 #include <ctime> 0015 0016 namespace soci 0017 { 0018 0019 namespace details 0020 { 0021 0022 // cast the given non-null untyped pointer to its corresponding type 0023 template <exchange_type e> struct exchange_type_traits; 0024 0025 template <> 0026 struct exchange_type_traits<x_char> 0027 { 0028 typedef char value_type; 0029 }; 0030 0031 template <> 0032 struct exchange_type_traits<x_stdstring> 0033 { 0034 typedef std::string value_type; 0035 }; 0036 0037 template <> 0038 struct exchange_type_traits<x_short> 0039 { 0040 typedef short value_type; 0041 }; 0042 0043 template <> 0044 struct exchange_type_traits<x_integer> 0045 { 0046 typedef int value_type; 0047 }; 0048 0049 template <> 0050 struct exchange_type_traits<x_long_long> 0051 { 0052 typedef long long value_type; 0053 }; 0054 0055 template <> 0056 struct exchange_type_traits<x_unsigned_long_long> 0057 { 0058 typedef unsigned long long value_type; 0059 }; 0060 0061 template <> 0062 struct exchange_type_traits<x_double> 0063 { 0064 typedef double value_type; 0065 }; 0066 0067 template <> 0068 struct exchange_type_traits<x_stdtm> 0069 { 0070 typedef std::tm value_type; 0071 }; 0072 0073 template <> 0074 struct exchange_type_traits<x_longstring> 0075 { 0076 typedef long_string value_type; 0077 }; 0078 0079 template <> 0080 struct exchange_type_traits<x_xmltype> 0081 { 0082 typedef xml_type value_type; 0083 }; 0084 0085 // exchange_type_traits not defined for x_statement, x_rowid and x_blob here. 0086 0087 template <exchange_type e> 0088 typename exchange_type_traits<e>::value_type& exchange_type_cast(void *data) 0089 { 0090 return *static_cast<typename exchange_type_traits<e>::value_type*>(data); 0091 } 0092 0093 } // namespace details 0094 0095 } // namespace soci 0096 0097 #endif // SOCI_EXCHANGE_CAST_H_INCLUDED