/////////////////////////////////////////////////////////////////////// // $Id: IDbiRowStream.cxx,v 1.1 2011/01/18 05:49:20 finch Exp $ // // COMET::IDbiRowStream // // Package: COMET::IDbi (Database Interface). // Begin_Html // Warning for beginners.
// Also see The ROOT Crib and // The MINOS Class User GuideEnd_Html // // N. West 04/2001 // // Concept: I/O buffer for a row of a table. // // Purpose: This forms the base class for COMET::IDbiInRowStream (input) // and COMET::IDbiWriter (input) // /////////////////////////////////////////////////////////////////////// #include "IDbiTableMetaData.hxx" #include "IDbiRowStream.hxx" #include #include using std::endl; #include "UtilString.hxx" ClassImp(COMET::IDbiRowStream) // Definition of static data members // ********************************* // Definition of all member functions (static or otherwise) // ******************************************************* // // - ordered: ctors, dtor, operators then in alphabetical order. //..................................................................... COMET::IDbiRowStream::IDbiRowStream(const COMET::IDbiTableMetaData* metaData) : fCurCol(1), fMetaData(metaData), fIsVLDTable(false) { // // // Purpose: Default constructor // // Arguments: // metaData in Meta data for table. // tableName in Table name. // // Return: n/a // // Contact: N. West // // Specification:- // ============= // // o Create RowStream. // Program Notes:- // ============= // None. COMETTrace( "Creating COMET::IDbiRowStream" << " "); std::string suffix(this->TableName(),this->TableName().size()-3); fIsVLDTable = suffix == "VLD"; } //..................................................................... COMET::IDbiRowStream::~IDbiRowStream() { // // // Purpose: Destructor // // Arguments: // None. // // Return: n/a // // Contact: N. West // // Specification:- // ============= // // o Destroy RowStream. // Program Notes:- // ============= // None. COMETTrace( "Destroying COMET::IDbiRowStream" << " "); } //..................................................................... const COMET::IDbiFieldType& COMET::IDbiRowStream::ColFieldType(UInt_t col) const { // // // Purpose: Return specified column type, if defined // // Arguments: None. return fMetaData->ColFieldType(col); } //..................................................................... string COMET::IDbiRowStream::ColName(UInt_t col) const { // // // Purpose: Return specified column name, if defined return fMetaData->ColName(col); } //..................................................................... const COMET::IDbiFieldType& COMET::IDbiRowStream::CurColFieldType() const { // // // Purpose: Return current column type, if defined // // Arguments: None. // // Return: Current column type, if defined. Unknown otherwise. // // Contact: N. West // // Specification:- // ============= // // o Current column name, if defined. unknown otherwise. // Program Notes:- // ============= // None. return fMetaData->ColFieldType(fCurCol); } //..................................................................... string COMET::IDbiRowStream::CurColName() const { // // // Purpose: Return current column name, if defined // // Arguments: None. // // Return: Current column name, if defined. "Undefined" otherwise. // // Contact: N. West // // Specification:- // ============= // // o Current column name, if defined. "Undefined" otherwise. // Program Notes:- // ============= // None. return fMetaData->ColName(fCurCol); } //..................................................................... UInt_t COMET::IDbiRowStream::NumCols() const { // // // Purpose: Return the number of columns. // // Arguments: None. // // Return: the number of columns // // Contact: N. West // // Specification:- // ============= // // o Return the number of columns. // Program Notes:- // ============= // None. return fMetaData->NumCols(); } //..................................................................... Bool_t COMET::IDbiRowStream::HasEpoch() const { return fMetaData->HasEpoch(); } //..................................................................... string COMET::IDbiRowStream::TableName() const { // // // Purpose: Return table name in upper case. // return COMET::UtilString::ToUpper(fMetaData->TableName()); } //..................................................................... string COMET::IDbiRowStream::TableNameTc() const { // // // Purpose: Return table name in true case. return fMetaData->TableName(); } /* Template for New Member Function //..................................................................... COMET::IDbiRowStream:: { // // // Purpose: // // Arguments: // xxxxxxxxx in yyyyyy // // Return: // // Contact: N. West // // Specification:- // ============= // // o // Program Notes:- // ============= // None. } */