#include <CoraCoolSequence.h>
Definition at line 15 of file CoraCoolSequence.h.
◆ CoraCoolSequence() [1/2]
CoraCoolSequence::CoraCoolSequence |
( |
const std::string & |
dbname, |
|
|
const std::string & |
seqname, |
|
|
coral::ISessionProxy * |
proxy, |
|
|
bool |
create = false |
|
) |
| |
Definition at line 26 of file CoraCoolSequence.cxx.
33 const std::string keytblname=
m_dbname+
"_CORACOOLKEYS";
38 catch (coral::SchemaException&
e) {
41 coral::TableDescription tdesc(keytblname);
42 tdesc.setName(keytblname);
43 tdesc.insertColumn(
"SEQNAME",
"string",63,
false);
44 tdesc.insertColumn(
"SEQVAL",
"int");
45 tdesc.setPrimaryKey(
"SEQNAME");
48 m_proxy->transaction().commit();
50 m_proxy->transaction().start(
false);
56 "CoraCoolSequence::CoraCoolSequence");
64 data.extend<std::string>(
"SEQNAME");
65 data.extend<
int>(
"SEQVAL");
67 data[1].data<
int>()=0;
68 coral::ITableDataEditor& editor=
m_table->dataEditor();
69 editor.insertRow(
data);
◆ CoraCoolSequence() [2/2]
CoraCoolSequence::CoraCoolSequence |
( |
| ) |
|
|
private |
◆ dropSeq()
bool CoraCoolSequence::dropSeq |
( |
| ) |
|
Definition at line 124 of file CoraCoolSequence.cxx.
126 bindvar.extend<std::string>(
"SKEY");
127 bindvar[0].data<std::string>()=
m_seqname;
128 coral::ITableDataEditor& editor=
m_table->dataEditor();
129 long rows=editor.deleteRows(
"SEQNAME=:SKEY",bindvar);
◆ fetch()
int CoraCoolSequence::fetch |
( |
const int |
inc = 1 | ) |
|
Definition at line 73 of file CoraCoolSequence.cxx.
79 bindvar.extend<std::string>(
"SKEY");
81 bindvar.extend<
int>(
"SINC");
82 bindvar[1].data<
int>()=inc;
83 coral::ITableDataEditor& editor=
m_table->dataEditor();
84 int rowsupdated=editor.updateRows(
"SEQVAL=SEQVAL+:SINC",
85 "SEQNAME=:SKEY",bindvar);
87 "Unexpected number of rows locked in keytable",
88 "CoraCoolSequence::CoraCoolSequence");
91 "CoraCoolSequence::fetch");
◆ querySeq()
bool CoraCoolSequence::querySeq |
( |
int & |
keyval, |
|
|
bool |
update = false , |
|
|
bool |
gettable = false |
|
) |
| |
Definition at line 96 of file CoraCoolSequence.cxx.
98 const std::string keytblname=
m_dbname+
"_CORACOOLKEYS";
103 bindvar.extend<std::string>(
"SKEY");
104 bindvar[0].data<std::string>()=
m_seqname;
105 query->setCondition(
"SEQNAME=:SKEY",bindvar);
106 query->setRowCacheSize(2);
107 query->defineOutputType(
"SEQVAL",
"int");
115 keyval=
res[
"SEQVAL"].data<
int>();
◆ m_dbname
std::string CoraCoolSequence::m_dbname |
|
private |
◆ m_proxy
coral::ISessionProxy* CoraCoolSequence::m_proxy |
|
private |
◆ m_seqname
std::string CoraCoolSequence::m_seqname |
|
private |
◆ m_table
coral::ITable* CoraCoolSequence::m_table |
|
private |
The documentation for this class was generated from the following files: