OCILIB (C and C++ Driver for Oracle)  4.7.6
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
HandleStoreResolver.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/config.hpp"
24 #include "ocilibcpp/core.hpp"
25 
26 namespace ocilib
27 {
28  namespace support
29  {
33  template<bool T, int U>
35  {
36  static const bool RequireStore = T;
37  static const core::SynchronizationMode SynchMode = static_cast<core::SynchronizationMode>(U);
38  };
39 
44  template<class T>
45  struct HandleStoreResolver : HandleStoreResolverType<false, core::SynchronizationMode::Unsafe> {};
46 
48  template<> struct HandleStoreResolver<OCI_Connection*> : HandleStoreResolverType<true, core::SynchronizationMode::Unsafe> {};
49  template<> struct HandleStoreResolver<OCI_Statement*> : HandleStoreResolverType<true, core::SynchronizationMode::Unsafe> {};
50  template<> struct HandleStoreResolver<OCI_Resultset*> : HandleStoreResolverType<true, core::SynchronizationMode::Unsafe> {};
51  template<> struct HandleStoreResolver<OCI_TypeInfo*> : HandleStoreResolverType<true, core::SynchronizationMode::Unsafe> {};
52  template<> struct HandleStoreResolver<OCI_Object*> : HandleStoreResolverType<true, core::SynchronizationMode::Unsafe> {};
53  }
54 }
struct OCI_Connection OCI_Connection
Oracle physical connection.
Definition: types.h:124
struct OCI_Object OCI_Object
Oracle Named types representation.
Definition: types.h:309
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
Definition: types.h:136
struct OCI_Environment OCI_Environment
Environment object.
Definition: types.h:95
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
Definition: types.h:366
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
Definition: types.h:163
SynchronizationMode
Internal usage. Synchronization mode enumeration.
Definition: core.hpp:217
OCILIB ++ Namespace.
Internal usage. Allow resolving information required creating a handle store for a given C Handle.