OCILIB (C and C++ Driver for Oracle)  4.7.3
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-2021 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 }
OCILIB ++ Namespace.
Object used for executing SQL or PL/SQL statement and returning the produced results.
Definition: types.hpp:5536
Object identifying the SQL data type LONG.
Definition: config.hpp:202
Object identifying the SQL data type REF.
Definition: types.hpp:4825
Internal usage. Allow resolving a native type used by C API from a C++ type in binding operations...
Definition: support.hpp:45
Object identifying the SQL data type BFILE.
Definition: types.hpp:4319
Object identifying the SQL data type INTERVAL.
Definition: types.hpp:3091
Resolve a bind input / output types.
Simplified resolver for handle types.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Definition: config.hpp:138
Simplified resolver for scalar types that do not need translation.
Object identifying the SQL data type NUMBER.
Definition: types.hpp:2477
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: config.hpp:198
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
Object identifying the SQL data type TIMESTAMP.
Definition: types.hpp:3490
Object identifying the SQL data type OBJECT.
Definition: types.hpp:4645
Object identifying the SQL data type DATE.
Definition: types.hpp:2655