BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
rdbModel::Row Class Reference

#include <Column.h>

Public Member Functions

 Row ()
 Row (std::vector< FieldVal > &fields)
 ~Row ()
void rowSort ()
void addField (const FieldVal &f)
void clear ()
FieldValfind (std::string colname)
void regroup (std::vector< std::string > &colNames, std::vector< std::string > &colVals, std::vector< std::string > &nullCols) const
 Reorder information suitable for Connection::insert.
 Row ()
 Row (std::vector< FieldVal > &fields)
 ~Row ()
void rowSort ()
void addField (const FieldVal &f)
void clear ()
FieldValfind (std::string colname)
void regroup (std::vector< std::string > &colNames, std::vector< std::string > &colVals, std::vector< std::string > &nullCols) const
 Reorder information suitable for Connection::insert.
 Row ()
 Row (std::vector< FieldVal > &fields)
 ~Row ()
void rowSort ()
void addField (const FieldVal &f)
void clear ()
FieldValfind (std::string colname)
void regroup (std::vector< std::string > &colNames, std::vector< std::string > &colVals, std::vector< std::string > &nullCols) const
 Reorder information suitable for Connection::insert.

Detailed Description

 @class Row

A collection of column names and values.

Definition at line 147 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

Constructor & Destructor Documentation

◆ Row() [1/6]

rdbModel::Row::Row ( )
inline

Definition at line 149 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

149: m_sorted( false ) { m_fields.clear(); }

◆ Row() [2/6]

rdbModel::Row::Row ( std::vector< FieldVal > & fields)
inline

Definition at line 150 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

150: m_fields( fields ), m_sorted( false ) {}

◆ ~Row() [1/3]

rdbModel::Row::~Row ( )
inline

Definition at line 152 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

152{ m_fields.clear(); }

◆ Row() [3/6]

rdbModel::Row::Row ( )
inline

Definition at line 149 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

149: m_sorted( false ) { m_fields.clear(); }

◆ Row() [4/6]

rdbModel::Row::Row ( std::vector< FieldVal > & fields)
inline

Definition at line 150 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

150: m_fields( fields ), m_sorted( false ) {}

◆ ~Row() [2/3]

rdbModel::Row::~Row ( )
inline

Definition at line 152 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

152{ m_fields.clear(); }

◆ Row() [5/6]

rdbModel::Row::Row ( )
inline

Definition at line 149 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

149: m_sorted( false ) { m_fields.clear(); }

◆ Row() [6/6]

rdbModel::Row::Row ( std::vector< FieldVal > & fields)
inline

Definition at line 150 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

150: m_fields( fields ), m_sorted( false ) {}

◆ ~Row() [3/3]

rdbModel::Row::~Row ( )
inline

Definition at line 152 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

152{ m_fields.clear(); }

Member Function Documentation

◆ addField() [1/3]

void rdbModel::Row::addField ( const FieldVal & f)
inline

Definition at line 154 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

154 {
155 m_fields.push_back( f );
156 m_sorted = false;
157 }
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")

Referenced by doSupersedes(), and rdbModel::Table::supersedeRow().

◆ addField() [2/3]

void rdbModel::Row::addField ( const FieldVal & f)
inline

Definition at line 154 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

154 {
155 m_fields.push_back( f );
156 m_sorted = false;
157 }

◆ addField() [3/3]

void rdbModel::Row::addField ( const FieldVal & f)
inline

Definition at line 154 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

154 {
155 m_fields.push_back( f );
156 m_sorted = false;
157 }

◆ clear() [1/3]

void rdbModel::Row::clear ( )
inline

Definition at line 158 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

158{ m_fields.clear(); }

◆ clear() [2/3]

void rdbModel::Row::clear ( )
inline

Definition at line 158 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

158{ m_fields.clear(); }

◆ clear() [3/3]

void rdbModel::Row::clear ( )
inline

Definition at line 158 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

158{ m_fields.clear(); }

◆ find() [1/3]

FieldVal * rdbModel::Row::find ( std::string colname)

Definition at line 65 of file Column.cxx.

65 {
66 unsigned nField = m_fields.size();
67 unsigned minI = 0;
68 unsigned maxI = nField;
69
70 unsigned guess = maxI / 2;
71 unsigned oldGuess = nField;
72
73 int cmp = colname.compare( m_fields[guess].m_colname );
74
75 while ( cmp != 0 )
76 {
77 if ( guess == oldGuess ) return 0; // not found
78
79 if ( cmp < 0 )
80 { // thing we tried is > colName, so decrease maxI
81 maxI = guess;
82 }
83 else
84 { // thing we tried is > colName, so increase minI
85 minI = guess;
86 }
87 oldGuess = guess;
88 guess = ( minI + maxI ) / 2;
89 cmp = colname.compare( m_fields[guess].m_colname );
90 }
91 return &m_fields[guess];
92 }

Referenced by rdbModel::Table::insertLatest(), rdbModel::Table::insertRow(), rdbModel::Assertion::Operator::Operator(), rdbModel::Table::supersedeRow(), and rdbModel::Assertion::Operator::verify().

◆ find() [2/3]

FieldVal * rdbModel::Row::find ( std::string colname)

◆ find() [3/3]

FieldVal * rdbModel::Row::find ( std::string colname)

◆ regroup() [1/3]

void rdbModel::Row::regroup ( std::vector< std::string > & colNames,
std::vector< std::string > & colVals,
std::vector< std::string > & nullCols ) const

Reorder information suitable for Connection::insert.

Definition at line 94 of file Column.cxx.

95 {
96 unsigned nFields = m_fields.size();
97 colNames.reserve( nFields );
98 colVals.reserve( nFields );
99
100 for ( unsigned i = 0; i < nFields; i++ )
101 {
102 if ( m_fields[i].m_null ) { nullCols.push_back( m_fields[i].m_colname ); }
103 else
104 {
105 colNames.push_back( m_fields[i].m_colname );
106 colVals.push_back( m_fields[i].m_val );
107 }
108 }
109 }

Referenced by rdbModel::Table::insertLatest(), rdbModel::Table::insertRow(), and rdbModel::Table::updateRows().

◆ regroup() [2/3]

void rdbModel::Row::regroup ( std::vector< std::string > & colNames,
std::vector< std::string > & colVals,
std::vector< std::string > & nullCols ) const

Reorder information suitable for Connection::insert.

◆ regroup() [3/3]

void rdbModel::Row::regroup ( std::vector< std::string > & colNames,
std::vector< std::string > & colVals,
std::vector< std::string > & nullCols ) const

Reorder information suitable for Connection::insert.

◆ rowSort() [1/3]

void rdbModel::Row::rowSort ( )

Definition at line 57 of file Column.cxx.

57 {
58 if ( m_sorted ) return;
59
60 FieldValCompare cmp;
61 std::sort( m_fields.begin(), m_fields.end(), cmp );
62 m_sorted = true;
63 }

Referenced by rdbModel::Assertion::Assertion(), rdbModel::Table::insertLatest(), rdbModel::Table::insertRow(), rdbModel::Table::supersedeRow(), rdbModel::Table::updateRows(), and rdbModel::Assertion::verify().

◆ rowSort() [2/3]

void rdbModel::Row::rowSort ( )

◆ rowSort() [3/3]

void rdbModel::Row::rowSort ( )

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