Main Page
Namespaces
Classes
Files
File List
File Members
libism
ISM
soci
src
core
procedure.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton
3
// Distributed under the Boost Software License, Version 1.0.
4
// (See accompanying file LICENSE_1_0.txt or copy at
5
// http://www.boost.org/LICENSE_1_0.txt)
6
//
7
8
#ifndef SOCI_PROCEDURE_H_INCLUDED
9
#define SOCI_PROCEDURE_H_INCLUDED
10
11
#include "
statement.h
"
12
13
namespace
soci
14
{
15
16
namespace
details
17
{
18
19
class
SOCI_DECL
procedure_impl
:
public
statement_impl
20
{
21
public
:
22
procedure_impl
(
session
& s) :
statement_impl
(s), refCount_(1) {}
23
procedure_impl
(
prepare_temp_type
const
& prep);
24
25
void
inc_ref
() { ++refCount_; }
26
void
dec_ref
()
27
{
28
if
(--refCount_ == 0)
29
{
30
delete
this
;
31
}
32
}
33
34
private
:
35
int
refCount_
;
36
};
37
38
}
// namespace details
39
40
class
SOCI_DECL
procedure
41
{
42
public
:
43
// this is a conversion constructor
44
procedure
(
details::prepare_temp_type
const
& prep)
45
: impl_(new details::procedure_impl(prep)) {}
46
47
~procedure
() { impl_->dec_ref(); }
48
49
// copy is supported here
50
procedure
(
procedure
const
& other)
51
: impl_(other.impl_)
52
{
53
impl_->inc_ref();
54
}
55
void
operator=
(
procedure
const
& other)
56
{
57
other.
impl_
->
inc_ref
();
58
impl_->dec_ref();
59
impl_ = other.
impl_
;
60
}
61
62
// forwarders to procedure_impl
63
// (or rather to its base interface from statement_impl)
64
65
bool
execute
(
bool
withDataExchange =
false
)
66
{
67
gotData_ = impl_->execute(withDataExchange);
68
return
gotData_;
69
}
70
71
bool
fetch
()
72
{
73
gotData_ = impl_->fetch();
74
return
gotData_;
75
}
76
77
bool
got_data
()
const
78
{
79
return
gotData_;
80
}
81
82
private
:
83
details::procedure_impl
*
impl_
;
84
bool
gotData_
;
85
};
86
87
}
// namespace soci
88
89
#endif
statement.h
soci::details::procedure_impl
Definition:
procedure.h:19
soci::procedure::procedure
procedure(details::prepare_temp_type const &prep)
Definition:
procedure.h:44
soci::procedure::gotData_
bool gotData_
Definition:
procedure.h:84
soci::details::procedure_impl::refCount_
int refCount_
Definition:
procedure.h:35
soci::details::prepare_temp_type
Definition:
prepare-temp-type.h:23
soci::procedure::impl_
details::procedure_impl * impl_
Definition:
procedure.h:83
SOCI_DECL
#define SOCI_DECL
Definition:
soci-config.h:31
soci::procedure
Definition:
procedure.h:40
soci::procedure::execute
bool execute(bool withDataExchange=false)
Definition:
procedure.h:65
soci::details::procedure_impl::procedure_impl
procedure_impl(session &s)
Definition:
procedure.h:22
soci::procedure::fetch
bool fetch()
Definition:
procedure.h:71
soci::session
Definition:
session.h:40
soci::procedure::got_data
bool got_data() const
Definition:
procedure.h:77
soci::procedure::procedure
procedure(procedure const &other)
Definition:
procedure.h:50
soci::details::statement_impl
Definition:
statement.h:37
soci::details::procedure_impl::dec_ref
void dec_ref()
Definition:
procedure.h:26
soci::details::procedure_impl::inc_ref
void inc_ref()
Definition:
procedure.h:25
soci::procedure::operator=
void operator=(procedure const &other)
Definition:
procedure.h:55
soci
Definition:
db2/common.h:15
soci::procedure::~procedure
~procedure()
Definition:
procedure.h:47
asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:40