22 unique_ptr<coral::IQuery> q(
m_session.nominalSchema().tableHandle(
"L1_RANDOM").newQuery());
23 q->setRowCacheSize( 5 );
25 coral::AttributeList bindList;
26 bindList.extend<
long>(
"rdId");
27 bindList[0].data<
long>() = rdTarget.
id();
29 q->setCondition(
"L1R_ID = :rdId", bindList );
32 coral::AttributeList attList;
34 attList.extend<std::string>(
"L1R_NAME" );
35 attList.extend<
int>(
"L1R_VERSION" );
36 attList.extend<
long>(
"L1R_RATE1" );
37 attList.extend<
long>(
"L1R_RATE2" );
39 attList.extend<
string>(
"L1R_CUT0" );
40 attList.extend<
string>(
"L1R_CUT1" );
41 attList.extend<
string>(
"L1R_CUT2" );
42 attList.extend<
string>(
"L1R_CUT3" );
46 coral::ICursor& cursor = q->execute();
48 if ( ! cursor.next() ) {
51 throw std::runtime_error(
"RandomLoader >> Random not available" );
54 const coral::AttributeList& row = cursor.currentRow();
56 std::string
name = row[
"L1R_NAME"].data<std::string>();
57 int version = row[
"L1R_VERSION"].data<
int>();
58 long rate1 = row[
"L1R_RATE1"].data<
long>();
59 long rate2 = row[
"L1R_RATE2"].data<
long>();
66 string cut0 = row[
"L1R_CUT0"].data<
string>();
67 string cut1 = row[
"L1R_CUT1"].data<
string>();
68 string cut2 = row[
"L1R_CUT2"].data<
string>();
69 string cut3 = row[
"L1R_CUT3"].data<
string>();
71 rdTarget.
setCut(0,
static_cast<uint32_t
>(std::stoul(cut0)));
72 rdTarget.
setCut(1,
static_cast<uint32_t
>(std::stoul(cut1)));
73 rdTarget.
setCut(2,
static_cast<uint32_t
>(std::stoul(cut2)));
74 rdTarget.
setCut(3,
static_cast<uint32_t
>(std::stoul(cut3)));
77 if ( cursor.next() ) {
80 throw std::runtime_error(
"RandomLoader >> Random not available" );
86 catch(
const coral::Exception& e ) {