36 {
37
39 msg() <<
"PrescaledClockLoader: Load PrescaledClock with ID = " << pcTarget.id() << std::endl;
40
41 try {
42
44 coral::ITable&
table =
m_session.nominalSchema().tableHandle(
"L1_PRESCALED_CLOCK");
46 query->setRowCacheSize( 5 );
47
48
49 coral::AttributeList bindList;
50 bindList.extend<long>("pcId");
51 std::string cond = "L1PC_ID = :pcId";
52 bindList[0].data<long>() = pcTarget.id();
53 query->setCondition( cond, bindList);
54
55
56 coral::AttributeList attList;
57 attList.extend<std::string>( "L1PC_NAME" );
58 attList.extend<int>( "L1PC_VERSION" );
59 attList.extend<int>( "L1PC_CLOCK1" );
60 attList.extend<int>( "L1PC_CLOCK2" );
61 attList.extend<long>( "L1PC_ID" );
62 query->defineOutput(attList);
63
64 query->addToOutputList(
"L1PC_NAME" );
65 query->addToOutputList(
"L1PC_VERSION" );
66 query->addToOutputList(
"L1PC_CLOCK1" );
67 query->addToOutputList(
"L1PC_CLOCK2" );
68 query->addToOutputList(
"L1PC_ID" );
69 query->addToOrderList(
"L1PC_ID" );
70
72
74 msg() <<
"PrescaledClockLoader >> No such prescaled clock exists "
75 << pcTarget.id() << std::endl;
78 throw std::runtime_error( "PrescaledClockLoader >> PrescaledClock not available" );
79 }
80
81 const coral::AttributeList&
row =
cursor.currentRow();
82 std::string
name =
row[
"L1PC_NAME"].data<std::string>();
84 int clock1 =
row[
"L1PC_CLOCK1"].data<
int>();
85 int clock2 =
row[
"L1PC_CLOCK2"].data<
int>();
86
88 msg() <<
"PrescaledClockLoader >> More than one PrescaledClock exists "
89 << pcTarget.id() << std::endl;
92 throw std::runtime_error( "PrescaledClockLoader >> PrescaledClock not available" );
93 }
94
95
96 pcTarget.setName( name );
97 pcTarget.setVersion( version );
98 pcTarget.setClock1( clock1 );
99 pcTarget.setClock2( clock2 );
100
103 return true;
104
105 } catch( const coral::SchemaException& e ) {
106 msg() <<
"PrescaledClockLoader >> SchemaException: "
107
108 <<
e.what() << std::endl;
110 return false;
111
112 } catch( const std::exception& e ) {
113 msg() <<
"PrescaledClockLoader >> Standard C++ exception: " <<
e.what() << std::endl;
114
116 return false;
117
118 } catch( ... ) {
119 msg() <<
"PrescaledClockLoader >> Uknown C++ exception" << std::endl;
120
122 return false;
123 }
124}
virtual int verbose() const override
void commitSession()
commit session if not already done
void startSession()
start session if not already active
MsgStreamTC & msg() const
The standard message stream.
row
Appending html table to final .html summary file.