Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91906192
sql_pusher.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 15, 15:23
Size
2 KB
Mime Type
text/x-c
Expires
Sun, Nov 17, 15:23 (2 d)
Engine
blob
Format
Raw Data
Handle
22344923
Attached To
R3127 blackdynamite
sql_pusher.hh
View Options
#ifndef __BLACKDYNAMITE_SQL_PUSHER_HH__
#define __BLACKDYNAMITE_SQL_PUSHER_HH__
/* -------------------------------------------------------------------------- */
#include "pusher.hh"
#include <cmath>
/* -------------------------------------------------------------------------- */
namespace
BlackDynamite
{
template
<
typename
type
,
bool
is_scalar
>
class
Pusher
::
SqlPusher
:
public
pqxx
::
transactor
<
transaction
>
{
typedef
transaction_input
<
type
,
is_scalar
>
InputObject
;
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public
:
SqlPusher
(
InputObject
&
input
)
:
pqxx
::
transactor
<
transaction
>
(
"Inserting into table"
+
input
.
tablename
),
input
(
input
)
{}
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
void
operator
()(
transaction
&
T
);
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private
:
InputObject
&
input
;
};
/* -------------------------------------------------------------------------- */
//partial specialization when scalartype
template
<
typename
type
>
class
Pusher
::
SqlPusher
<
type
,
true
>:
public
pqxx
::
transactor
<
transaction
>
{
typedef
Pusher
::
transaction_input
<
type
,
true
>
InputObject
;
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public
:
SqlPusher
(
InputObject
&
input
)
:
pqxx
::
transactor
<
transaction
>
(
"Inserting into table"
+
input
.
tablename
),
input
(
input
)
{}
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
void
operator
()(
transaction
&
T
);
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private
:
InputObject
&
input
;
};
/* -------------------------------------------------------------------------- */
#include "sql_pusher_inline_impl.cc"
/* -------------------------------------------------------------------------- */
}
#endif
/* __BLACKDYNAMITE_SQL_PUSHER_HH__ */
Event Timeline
Log In to Comment