OCILIB (C and C++ Driver for Oracle)  4.7.6
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
BindResolver.hpp
1 /*
2  * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)
3  *
4  * Website: http://www.ocilib.net
5  *
6  * Copyright (c) 2007-2023 Vincent ROGIER <vince.rogier@ocilib.net>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #pragma once
22 
23 #include "ocilibcpp/support.hpp"
24 
25 namespace ocilib
26 {
27  namespace support
28  {
34  template<class I, class O, boolean B>
36  {
37  typedef I InputType;
38  typedef O OutputType;
39  static const bool IsHandle = B;
40  };
41 
47  template<class T>
48  struct BindResolverScalarType : BindResolverType<T, T, false> {};
49 
55  template<class I, class O>
56  struct BindResolverHandleType : BindResolverType<I, O, true> {};
57 
58  template<> struct BindResolver<bool> : BindResolverType<bool, boolean, false> {};
59  template<> struct BindResolver<short> : BindResolverScalarType<short> {};
60  template<> struct BindResolver<unsigned short> : BindResolverScalarType<unsigned short> {};
61  template<> struct BindResolver<int> : BindResolverScalarType<int> {};
62  template<> struct BindResolver<unsigned int> : BindResolverScalarType<unsigned int> {};
63  template<> struct BindResolver<big_int> : BindResolverScalarType<big_int> {};
64  template<> struct BindResolver<big_uint> : BindResolverScalarType<big_uint> {};
65  template<> struct BindResolver<float> : BindResolverScalarType<float> {};
66  template<> struct BindResolver<double> : BindResolverScalarType<double> {};
67  template<> struct BindResolver<ocilib::ostring> : BindResolverType<ocilib::ostring, otext, false> {};
68  template<> struct BindResolver<ocilib::Raw> : BindResolverType<ocilib::ostring, unsigned char, false> {};
69  template<> struct BindResolver<ocilib::Number> : BindResolverHandleType<ocilib::Number, OCI_Number*> {};
70  template<> struct BindResolver<ocilib::Date> : BindResolverHandleType<ocilib::Date, OCI_Date*> {};
71  template<> struct BindResolver<ocilib::Timestamp> : BindResolverHandleType<ocilib::Timestamp, OCI_Timestamp*> {};
72  template<> struct BindResolver<ocilib::Interval> : BindResolverHandleType<ocilib::Interval, OCI_Interval*> {};
73  template<> struct BindResolver<ocilib::Clob> : BindResolverHandleType<ocilib::Clob, OCI_Lob*> {};
74  template<> struct BindResolver<ocilib::NClob> : BindResolverHandleType<ocilib::NClob, OCI_Lob*> {};
75  template<> struct BindResolver<ocilib::Blob> : BindResolverHandleType<ocilib::Blob, OCI_Lob*> {};
76  template<> struct BindResolver<ocilib::File> : BindResolverHandleType<ocilib::File, OCI_File*> {};
77  template<> struct BindResolver<ocilib::Clong> : BindResolverHandleType<ocilib::Clong, OCI_Long*> {};
78  template<> struct BindResolver<ocilib::Blong> : BindResolverHandleType<ocilib::Blong, OCI_Long*> {};
79  template<> struct BindResolver<ocilib::Reference> : BindResolverHandleType<ocilib::Reference, OCI_Ref*> {};
80  template<> struct BindResolver<ocilib::Object> : BindResolverHandleType<ocilib::Object, OCI_Object*> {};
81  template<> struct BindResolver<ocilib::Statement> : BindResolverHandleType<ocilib::Statement, OCI_Statement*> {};
82  }
83 }
long long big_int
big_int is a C scalar integer (32 or 64 bits) depending on compiler support for 64bits integers....
Definition: platform.h:281
OCILIB ++ Namespace.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets )
Definition: config.hpp:120
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
Definition: types.hpp:5372
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: types.hpp:4320
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: types.hpp:4309
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Definition: config.hpp:138
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
Definition: types.hpp:5361
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: types.hpp:4331
Simplified resolver for handle types.
Internal usage. Allow resolving a native type used by C API from a C++ type in binding operations.
Definition: support.hpp:45
Simplified resolver for scalar types that do not need translation.
Resolve a bind input / output types.