BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
rdbModel::Supersede Class Reference

#include <Supersede.h>

Public Member Functions

 Supersede (Table *table, Assertion *onlyIf=0)
 
 ~Supersede ()
 
const std::vector< Set * > & getSetOld () const
 
const std::vector< Set * > & getSetNew () const
 
void addSet (Set *s)
 
const TablegetTable () const
 
Visitor::VisitorState accept (Visitor *v)
 
AssertiongetOnlyIf ()
 
const std::vector< std::string > & getAsk () const
 
const std::vector< std::string > & getOldDefaulted () const
 
const std::vector< std::string > & getFromOld () const
 
const std::vector< FieldVal > & getFixed () const
 
const std::vector< std::string > & getFixedInterp () const
 
const std::vector< std::string > & getForced () const
 
void setOnlyIf (Assertion *onlyIf)
 
void normalize ()
 

Detailed Description

Supersede operation needs to o change one or more column values in row being superseded o set values in new, superseding row. Default is to assume values come from the old row; only specify those that don't

Definition at line 20 of file Supersede.h.

Constructor & Destructor Documentation

◆ Supersede()

rdbModel::Supersede::Supersede ( Table table,
Assertion onlyIf = 0 
)

Definition at line 9 of file Supersede.cxx.

9 :
10 m_myTable(table), m_onlyIf(onlyIf), m_normalized(false) {
11 m_setOld.clear();
12 m_setNew.clear();
13 m_oldDefaults.clear();
14 m_oldForced.clear();
15 m_ask.clear();
16 m_fixed.clear();
17 }

◆ ~Supersede()

rdbModel::Supersede::~Supersede ( )

Definition at line 75 of file Supersede.cxx.

75 {
76 while (m_setOld.size() ) {
77 Set* s = m_setOld.back();
78 m_setOld.pop_back();
79 delete s;
80 }
81 while (m_setNew.size() ) {
82 Set* s = m_setNew.back();
83 m_setNew.pop_back();
84 delete s;
85 }
86 // delete m_onlyIf; probably already handled by ~Table
87 }
XmlRpcServer s
Definition: HelloServer.cpp:11

Member Function Documentation

◆ accept()

Visitor::VisitorState rdbModel::Supersede::accept ( Visitor v)

Definition at line 90 of file Supersede.cxx.

90 {
91 Visitor::VisitorState state = v->visitSupersede(this);
92 if (state == Visitor::VBRANCHDONE) return Visitor::VCONTINUE;
93 return state;
94 }
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35

◆ addSet()

void rdbModel::Supersede::addSet ( Set s)

Definition at line 19 of file Supersede.cxx.

19 {
20 FIELDTYPE vtype = s->getDestType();
21 switch(vtype) {
22 case FIELDTYPEold:
23 case FIELDTYPEoldDef: // this shouldn't occur
24 m_setOld.push_back(s); break;
25 case FIELDTYPEtoBe:
26 case FIELDTYPEtoBeDef: // nor this
27 m_setNew.push_back(s); break;
28 default: throw RdbException("Bad value type for <set> destination");
29 }
30 return;
31 }
FIELDTYPE
Definition: Rdb.h:21
@ FIELDTYPEtoBe
Definition: Rdb.h:24
@ FIELDTYPEold
Definition: Rdb.h:23
@ FIELDTYPEtoBeDef
Definition: Rdb.h:28
@ FIELDTYPEoldDef
Definition: Rdb.h:27

◆ getAsk()

const std::vector< std::string > & rdbModel::Supersede::getAsk ( ) const
inline

Definition at line 37 of file Supersede.h.

37 {
38 return m_ask; }

◆ getFixed()

const std::vector< FieldVal > & rdbModel::Supersede::getFixed ( ) const
inline

Definition at line 46 of file Supersede.h.

46{ return m_fixed;}

Referenced by rdbModel::Table::supersedeRow().

◆ getFixedInterp()

const std::vector< std::string > & rdbModel::Supersede::getFixedInterp ( ) const
inline

Definition at line 47 of file Supersede.h.

47 {
48 return m_fixedInterp;}

Referenced by rdbModel::Table::supersedeRow().

◆ getForced()

const std::vector< std::string > & rdbModel::Supersede::getForced ( ) const
inline

Definition at line 50 of file Supersede.h.

50{ return m_oldForced;}

Referenced by rdbModel::Table::supersedeRow().

◆ getFromOld()

const std::vector< std::string > & rdbModel::Supersede::getFromOld ( ) const
inline

Definition at line 43 of file Supersede.h.

43 {
44 return m_fromOld;}

Referenced by rdbModel::Table::supersedeRow().

◆ getOldDefaulted()

const std::vector< std::string > & rdbModel::Supersede::getOldDefaulted ( ) const
inline

Definition at line 40 of file Supersede.h.

40 {
41 return m_oldDefaults; }

Referenced by rdbModel::Table::supersedeRow().

◆ getOnlyIf()

Assertion * rdbModel::Supersede::getOnlyIf ( )
inline

Definition at line 35 of file Supersede.h.

35{return m_onlyIf;}

◆ getSetNew()

const std::vector< Set * > & rdbModel::Supersede::getSetNew ( ) const
inline

Definition at line 27 of file Supersede.h.

27{return m_setOld;}

◆ getSetOld()

const std::vector< Set * > & rdbModel::Supersede::getSetOld ( ) const
inline

Definition at line 26 of file Supersede.h.

26{return m_setOld;}

Referenced by rdbModel::Table::supersedeRow().

◆ getTable()

const Table * rdbModel::Supersede::getTable ( ) const
inline

Definition at line 31 of file Supersede.h.

31{return m_myTable;}

◆ normalize()

void rdbModel::Supersede::normalize ( )

Initialize m_oldDefaults, m_oldForced, m_ask and m_fixed if it hasn't been done already

Definition at line 34 of file Supersede.cxx.

34 {
35 if (m_normalized) return;
36 // unsigned nOld = m_setOld.size();
37 unsigned nNew = m_setNew.size();
38 // For each object in m_setNew, store information in one of the
39 // vectors of column names or in m_fixed for easy access later
40 for (unsigned iNew = 0; iNew < nNew; iNew++) {
41 // FIELDTYPE srcType = m_setOld[iOld]->getSrcType();
42 // switch (srcType) {
43 switch (m_setNew[iNew]->getSrcType()) {
44 case FIELDTYPEold:
45 m_oldForced.push_back(m_setNew[iNew]->getDestColName());
46 break;
47 case FIELDTYPEoldDef:
48 m_oldDefaults.push_back(m_setNew[iNew]->getDestColName());
49 break;
50 case FIELDTYPEask:
51 m_ask.push_back(m_setNew[iNew]->getDestColName());
52 break;
53 case FIELDTYPElit:
54 m_fixed.push_back(FieldVal(m_setNew[iNew]->getDestColName(),
55 m_setNew[iNew]->getSrcValue()));
56 m_fixedInterp.push_back(m_setNew[iNew]->getInterp());
57 break;
58 default:
59 throw RdbException("Supersede::normalize Unrecognized <set>");
60 }
61 }
62
63 m_fromOld.reserve(m_oldDefaults.size() + m_oldForced.size());
64 m_fromOld.clear();
65 for (unsigned i = 0; i < m_oldDefaults.size(); i++) {
66 m_fromOld.push_back(m_oldDefaults[i]);
67 }
68 for (unsigned i = 0; i < m_oldForced.size(); i++) {
69 m_fromOld.push_back(m_oldForced[i]);
70 }
71 m_normalized = true;
72 }
@ FIELDTYPElit
Definition: Rdb.h:22
@ FIELDTYPEask
Definition: Rdb.h:25

◆ setOnlyIf()

void rdbModel::Supersede::setOnlyIf ( Assertion onlyIf)
inline

Definition at line 57 of file Supersede.h.

57{m_onlyIf = onlyIf;}

The documentation for this class was generated from the following files: