// =====================================================================
/*!
//
//  \file TRunInformationTable.hh
//  \brief This file contains the TRunInformationTable class.
//  \author Go IWAI <goiwai@users.sourceforge.jp>
//
//  $Id: TRunInformationTable.hh,v 1.6 2004/03/07 10:30:34 goiwai Exp $
//  $Name: CLDAQ-1-14-06 $
//  $Log: TRunInformationTable.hh,v $
//  Revision 1.6  2004/03/07 10:30:34  goiwai
//  ROOTに組みこむためのおまじないマクロを埋めこみました。
//  全てにおいて完全に動作するわけではありません。
//
//  Revision 1.5  2004/01/19 21:09:43  goiwai
//  プリプロセッサの接頭辞をCLDAQ__に変更しました.
//
//  Revision 1.4  2003/11/03 08:35:14  goiwai
//  Doxygen用のタグとコメントをうちこんでいく試みを開始しました.
//
//  Revision 1.3  2003/10/06 17:02:45  goiwai
//  *** empty log message ***
//
//  Revision 1.2  2003/07/30 16:20:31  goiwai
//  ファイルにコミットログをつけることにしました.
//
*/
// =====================================================================
#ifndef CLDAQ__TRUNINFORMATIONTABLE_HH
#define CLDAQ__TRUNINFORMATIONTABLE_HH

#include "Tglobals.h"
#include "TRunInformationList.hh"

class TOutputHtmlFileStream;


/*!
// \example
//
// If example code exists.
//
*/

/*!
// \class TRunInformationTable
// \brief This is the TRunInformationTable class.
// \author Go IWAI <goiwai@users.sourceforge.jp>
//
// The TRunInformationTable class detail description.
// Write it down ASAP!
//
// \todo None?
// \bug None?
// \ingroup RunCategory
*/
class TRunInformationTable
{

  public:
    enum { tNotFound = -1 };

  private:
    TRunInformationList theRunInformationList;

  public:
    TRunInformationTable();
    TRunInformationTable( const TRunInformationList& infolist );
    TRunInformationTable( const TRunInformationTable& right );
    ~TRunInformationTable();

  public:
    const TRunInformationTable& operator=( const TRunInformationTable& right );
    Tbool operator==( const TRunInformationTable& right ) const;
    Tbool operator!=( const TRunInformationTable& right ) const;
    friend Tostream& operator<<( Tostream& tos, const TRunInformationTable& right );
    friend TOutputHtmlFileStream& operator<<( TOutputHtmlFileStream& html, const TRunInformationTable& right );
    friend TRunInformationTable operator+( const TRunInformationList& left, const TRunInformationTable& right );
    friend TRunInformationTable operator+( const TRunInformation& left, const TRunInformationTable& right );

  public:
    TRunInformationTable operator+( const TRunInformationTable& right ) const;
    TRunInformationTable operator+( const TRunInformationList& right ) const;
    TRunInformationTable operator+( const TRunInformation& right ) const;
    TRunInformationTable& operator+=( const TRunInformationTable& right );
    TRunInformationTable& operator+=( const TRunInformationList& right );
    TRunInformationTable& operator+=( const TRunInformation& right );

  public:
    const TRunInformationList& GetRunInformationList() const;
    TRunInformationList& GetRunInformationList();
    Tvoid SetRunInformationList( const TRunInformationList& infolist );

  public:
    Tint GetNumberOfRows() const;
    Tvoid SetRunInformation( const Tstring& item );
    Tvoid SetRunInformation( const Tstring& item, const Tstring& value );
    Tvoid SetRunInformation( const TRunInformation& runinfo );
    Tvoid SetRunInformation();
    Tvoid AddRunInformation( const Tstring& item );
    Tvoid AddRunInformation( const Tstring& item, const Tstring& value );
    Tvoid AddRunInformation( const TRunInformation& runinfo );
    Tvoid AddRunInformation();
    Tstring GetItem( const Tstring& value ) const;
    Tstring GetItem( Tint nrow ) const;
    Tstring GetValue( const Tstring& item ) const;
    Tstring GetValue( Tint nrow ) const;
    Tint FindItem( const Tstring& item ) const;
    Tint FindValue( const Tstring& value ) const;
    Tint FindRunInformation( const TRunInformation& runinfo ) const;
    Tbool HasItem( const Tstring& item ) const;
    Tbool HasRunInformation( const TRunInformation& runinfo ) const;
    Tvoid Remove( const Tstring& item );
    Tvoid Remove( const TRunInformation& runinfo );
    Tvoid Clear();

#ifdef __CLDAQ_ROOT_DLL
    ClassDef(TRunInformationTable,0)
#endif

};

inline const TRunInformationList& TRunInformationTable::GetRunInformationList() const
{
  return theRunInformationList;
}

inline TRunInformationList& TRunInformationTable::GetRunInformationList()
{
  return theRunInformationList;
}

inline Tvoid TRunInformationTable::SetRunInformationList( const TRunInformationList& infolist )
{
  theRunInformationList = infolist;
  return;
}

#endif
