#include <Column.h>
Public Member Functions | |
void | addField (const FieldVal &f) |
void | addField (const FieldVal &f) |
void | clear () |
void | clear () |
FieldVal * | find (std::string colname) |
FieldVal * | find (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. | |
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 (std::vector< FieldVal > &fields) | |
Row () | |
Row (std::vector< FieldVal > &fields) | |
Row () | |
void | rowSort () |
void | rowSort () |
~Row () | |
~Row () | |
Private Attributes | |
std::vector< FieldVal > | m_fields |
std::vector< FieldVal > | m_fields |
bool | m_sorted |
|
|
|
|
|
00155 { m_fields.clear(); }
|
|
|
|
|
|
00155 { m_fields.clear(); }
|
|
|
|
|
|
00158 {m_fields.clear();}
|
|
00158 {m_fields.clear();}
|
|
|
|
00073 { 00074 unsigned nField = m_fields.size(); 00075 unsigned minI = 0; 00076 unsigned maxI = nField; 00077 00078 unsigned guess = maxI/2; 00079 unsigned oldGuess = nField; 00080 00081 int cmp = colname.compare(m_fields[guess].m_colname); 00082 00083 while (cmp != 0) { 00084 if (guess == oldGuess) return 0; // not found 00085 00086 if (cmp < 0 ) { // thing we tried is > colName, so decrease maxI 00087 maxI = guess; 00088 } else { // thing we tried is > colName, so increase minI 00089 minI = guess; 00090 } 00091 oldGuess = guess; 00092 guess = (minI + maxI)/2; 00093 cmp = colname.compare(m_fields[guess].m_colname); 00094 } 00095 return &m_fields[guess]; 00096 }
|
|
Reorder information suitable for Connection::insert.
|
|
Reorder information suitable for Connection::insert.
00100 { 00101 unsigned nFields = m_fields.size(); 00102 colNames.reserve(nFields); 00103 colVals.reserve(nFields); 00104 00105 for (unsigned i = 0; i < nFields; i++) { 00106 if (m_fields[i].m_null) { 00107 nullCols.push_back(m_fields[i].m_colname); 00108 } 00109 else { 00110 colNames.push_back(m_fields[i].m_colname); 00111 colVals.push_back(m_fields[i].m_val); 00112 } 00113 } 00114 }
|
|
|
|
00065 { 00066 if (m_sorted) return; 00067 00068 FieldValCompare cmp; 00069 std::sort(m_fields.begin(), m_fields.end(), cmp); 00070 m_sorted = true; 00071 }
|
|
|
|
|
|
|