summaryrefslogtreecommitdiff
path: root/cpp/demo/Database/Oracle/proc/CurrentSqlContext.h
blob: fec65139e40d1f1d46e8b000f3abdb6f9e3008c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// **********************************************************************
//
// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#ifndef CURRENT_SQL_CONTEXT_H
#define CURRENT_SQL_CONTEXT_H

#include <Ice/Ice.h>

//
// Provides a sql_context for each thread created by the communicator(s)
// using the associated thread-notification object
//

//
// Note: sql_context is defined in Pro*C -generated code, so this
// header can only be included in .pc files.
//

class CurrentSqlContext
{
public:
    
    CurrentSqlContext(const std::string&);

    //
    // Default copy ctor and assignment operator ok
    // 

    Ice::ThreadNotificationPtr getHook() const;
    operator sql_context() const;

private:
    const std::string _connectInfo;
    size_t _index;
    Ice::ThreadNotificationPtr _hook;
};

#endif