Public Member Functions | Private Attributes | Friends | List of all members
nova::dbi::Row Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-01-23/Database/cxx/include/Row.h"

Public Member Functions

 Row (int ncol)
 
 Row (const std::vector< Column > &)
 
 Row (std::vector< ColumnDef > &)
 
 ~Row ()
 
void Clear ()
 
template<class T >
bool Set (int idx, T value)
 
template<class T >
bool Update (int idx, T value)
 
bool InDB ()
 
void SetInDB ()
 
int NModified ()
 
int NCol ()
 
ColumnCol (int i)
 Find index of column with name. Suitable for passing to Col. More...
 
unsigned long long Channel ()
 
time_t VldTime ()
 
time_t VldTimeEnd ()
 
bool IsVldRow ()
 
bool SetChannel (unsigned long long ch)
 
bool SetVldTime (time_t t)
 
bool SetVldTimeEnd (time_t t)
 

Private Attributes

bool fInDB
 
bool fIsVldRow
 
int fNModified
 
unsigned long long fChannel
 
time_t fVldTime
 
time_t fVldTimeEnd
 
std::vector< ColumnfCol
 

Friends

std::ostream & operator<< (std::ostream &stream, const Row &row)
 

Detailed Description

Generalized Database Row Interface

Author
Jonathan Paley
Version
Id
Row.h,v 1.16 2011/11/01 16:15:18 anorman Exp

Definition at line 26 of file Row.h.

Constructor & Destructor Documentation

nova::dbi::Row::Row ( int  ncol)
inline

Definition at line 29 of file Row.h.

References Clear(), and ~Row().

29 : fIsVldRow(false), fNModified(0), fCol(ncol) { };
int fNModified
Definition: Row.h:85
bool fIsVldRow
Definition: Row.h:84
std::vector< Column > fCol
Definition: Row.h:89
nova::dbi::Row::Row ( const std::vector< Column > &  col)

Definition at line 36 of file Row.cpp.

References fCol, and MECModelEnuComparisons::i.

36  :
37  fInDB(false), fIsVldRow(false), fNModified(0),
38  fChannel(0xffffffff),fVldTime(0),fVldTimeEnd(0)
39  {
40  for (unsigned int i=0; i<col.size(); ++i) {
41  fCol.push_back(Column(col[i]));
42  }
43  }
unsigned long long fChannel
Definition: Row.h:86
time_t fVldTime
Definition: Row.h:87
bool fInDB
Definition: Row.h:83
int fNModified
Definition: Row.h:85
Int_t col[ntarg]
Definition: Style.C:29
bool fIsVldRow
Definition: Row.h:84
time_t fVldTimeEnd
Definition: Row.h:88
std::vector< Column > fCol
Definition: Row.h:89
nova::dbi::Row::Row ( std::vector< ColumnDef > &  col)

Definition at line 47 of file Row.cpp.

References fCol, and MECModelEnuComparisons::i.

47  :
48  fInDB(false), fIsVldRow(false), fNModified(0),
49  fChannel(0xffffffff),fVldTime(0),fVldTimeEnd(0)
50  {
51  for (unsigned int i=0; i<col.size(); ++i)
52  fCol.push_back(Column(col[i]));
53  }
unsigned long long fChannel
Definition: Row.h:86
time_t fVldTime
Definition: Row.h:87
bool fInDB
Definition: Row.h:83
int fNModified
Definition: Row.h:85
Int_t col[ntarg]
Definition: Style.C:29
bool fIsVldRow
Definition: Row.h:84
time_t fVldTimeEnd
Definition: Row.h:88
std::vector< Column > fCol
Definition: Row.h:89
nova::dbi::Row::~Row ( )

Definition at line 57 of file Row.cpp.

Referenced by Row().

58  {
59 
60  }

Member Function Documentation

unsigned long long nova::dbi::Row::Channel ( )
inline
void nova::dbi::Row::Clear ( )

Definition at line 89 of file Row.cpp.

References fCol, and MECModelEnuComparisons::i.

Referenced by Row().

90  {
91  for (unsigned int i=0; i<fCol.size(); ++i)
92  fCol[i].Clear();
93 
94  }
std::vector< Column > fCol
Definition: Row.h:89
void Clear()
Definition: Row.cpp:89
Column& nova::dbi::Row::Col ( int  i)
inline
bool nova::dbi::Row::InDB ( )
inline

Definition at line 53 of file Row.h.

References fInDB.

53 { return fInDB; }
bool fInDB
Definition: Row.h:83
bool nova::dbi::Row::IsVldRow ( )
inline

Definition at line 71 of file Row.h.

References fIsVldRow.

71 { return fIsVldRow; }
bool fIsVldRow
Definition: Row.h:84
int nova::dbi::Row::NCol ( )
inline

Definition at line 58 of file Row.h.

References fCol.

58 { return fCol.size(); }
std::vector< Column > fCol
Definition: Row.h:89
int nova::dbi::Row::NModified ( )
inline

Definition at line 56 of file Row.h.

References fNModified.

Referenced by nova::dbi::Table::WriteToDB().

56 { return fNModified; }
int fNModified
Definition: Row.h:85
template<class T >
bool nova::dbi::Row::Set ( int  idx,
T  value 
)
inline

Definition at line 38 of file Row.h.

References fCol.

Referenced by nova::dbi::Table::WriteToDB().

38  {
39  if (idx < (int)fCol.size() && idx>=0)
40  return (fCol[idx].Set(value));
41  return false;
42  }
bool Set(int idx, T value)
Definition: Row.h:38
const XML_Char int const XML_Char * value
Definition: expat.h:331
std::vector< Column > fCol
Definition: Row.h:89
bool nova::dbi::Row::SetChannel ( unsigned long long  ch)
inline

Definition at line 73 of file Row.h.

References fChannel, and fIsVldRow.

73 { fIsVldRow=true; return (fChannel=ch); }
unsigned long long fChannel
Definition: Row.h:86
bool fIsVldRow
Definition: Row.h:84
void nova::dbi::Row::SetInDB ( )
inline

Definition at line 54 of file Row.h.

References fInDB.

54 { fInDB = true; }
bool fInDB
Definition: Row.h:83
bool nova::dbi::Row::SetVldTime ( time_t  t)
inline

Definition at line 74 of file Row.h.

References fIsVldRow, and fVldTime.

74 { fIsVldRow=true; return (fVldTime=t); }
time_t fVldTime
Definition: Row.h:87
bool fIsVldRow
Definition: Row.h:84
bool nova::dbi::Row::SetVldTimeEnd ( time_t  t)
inline

Definition at line 75 of file Row.h.

References fIsVldRow, fVldTimeEnd, operator<<, check_grl::row, and runNovaSAM::stream.

75 { fIsVldRow=true; return (fVldTimeEnd=t); }
bool fIsVldRow
Definition: Row.h:84
time_t fVldTimeEnd
Definition: Row.h:88
template<class T >
bool nova::dbi::Row::Update ( int  idx,
T  value 
)
inline

Definition at line 45 of file Row.h.

References fCol, fNModified, and Modified().

Referenced by progbar.ProgressBar::Finish(), progbar.ProgressBar::Start(), and nova::dbi::Table::WriteToDB().

45  {
46  if (idx < (int)fCol.size() && idx>=0) {
47  if (!fCol[idx].Modified()) fNModified++;
48  return (fCol[idx].Update(value));
49  }
50  return false;
51  }
bool Update(int idx, T value)
Definition: Row.h:45
const XML_Char int const XML_Char * value
Definition: expat.h:331
int fNModified
Definition: Row.h:85
std::vector< Column > fCol
Definition: Row.h:89
c1 Modified()
time_t nova::dbi::Row::VldTime ( )
inline

Definition at line 69 of file Row.h.

References fVldTime.

Referenced by nova::dbi::Table::FillChanRowMap(), cmap::CMap::LoadExceptions(), and nova::dbi::Table::MakeValidityCSVString().

69 { return fVldTime; }
time_t fVldTime
Definition: Row.h:87
time_t nova::dbi::Row::VldTimeEnd ( )
inline

Definition at line 70 of file Row.h.

References fVldTimeEnd.

Referenced by nova::dbi::Table::MakeValidityCSVString().

70 { return fVldTimeEnd; }
time_t fVldTimeEnd
Definition: Row.h:88

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Row row 
)
friend

Definition at line 95 of file Row.h.

Referenced by SetVldTimeEnd().

95  {
96  for (unsigned int i=0; i<row.fCol.size(); ++i) {
97  stream << row.fCol[i];
98  if (i < row.fCol.size()-1)
99  stream << ", ";
100  }
101  return stream;
102  }

Member Data Documentation

unsigned long long nova::dbi::Row::fChannel
private

Definition at line 86 of file Row.h.

Referenced by Channel(), and SetChannel().

std::vector<Column> nova::dbi::Row::fCol
private

Definition at line 89 of file Row.h.

Referenced by Clear(), Col(), NCol(), nova::dbi::operator<<(), Row(), Set(), and Update().

bool nova::dbi::Row::fInDB
private

Definition at line 83 of file Row.h.

Referenced by InDB(), and SetInDB().

bool nova::dbi::Row::fIsVldRow
private

Definition at line 84 of file Row.h.

Referenced by IsVldRow(), SetChannel(), SetVldTime(), and SetVldTimeEnd().

int nova::dbi::Row::fNModified
private

Definition at line 85 of file Row.h.

Referenced by NModified(), and Update().

time_t nova::dbi::Row::fVldTime
private

Definition at line 87 of file Row.h.

Referenced by SetVldTime(), and VldTime().

time_t nova::dbi::Row::fVldTimeEnd
private

Definition at line 88 of file Row.h.

Referenced by SetVldTimeEnd(), and VldTimeEnd().


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