Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbRooNTupleR.rdl

Go to the documentation of this file.
00001 #ifndef CDBROOTABLE_NTUPLE_R_RDL
00002 #define CDBROOTABLE_NTUPLE_R_RDL
00003 
00004 // File and Version Information:
00005 //      $Id: CdbRooNTupleR.rdl,v 1.3 2005/01/11 09:02:38 gapon Exp $
00006 
00007 #include "CdbRooTable/CdbRooNTupleBaseR.hh"
00008 
00009 /// An abstract base class for persistent n-tuples
00010 /**
00011   * This class adds a type safe interface of the n-tuple model by prividing
00012   * a set of virtual methods to access or modify the contents of a tuple.
00013   *
00014   * RESTRICTIONS:
00015   *
00016   *   (1) Rows are numbered beginning from 0.
00017   *
00018   *   (2) In all operations with rows, a row is defined through a STD vector
00019   *       of element type. The number of elements in the vector must be exactly
00020   *       the number of columns passed to the constructor.
00021   */
00022 template< class E >
00023 class CdbRooNTupleR : public CdbRooNTupleBaseR {
00024 
00025 public:
00026 
00027     typedef E ElementType;
00028 
00029 protected:
00030 
00031   /// Default constructor
00032   /**
00033     * Is useless, but it's required by the ROOT I/O streamers. Any attempts to use an object
00034     * constructed in this way would result in the corresponding errors reported.
00035     */
00036     CdbRooNTupleR( ) :
00037         CdbRooNTupleBaseR( )
00038     { }
00039 
00040   /// Normal constructor
00041   /**
00042     * @see CdbRooNTupleBaseR::CdbRooNTupleBaseR()
00043     */
00044     CdbRooNTupleR( UInt_t                          theNumberOfColumns,
00045                    const std::string&              theName,
00046                    const std::string&              theDescription,
00047                    const std::vector<std::string>& theColumnNames ) :
00048         CdbRooNTupleBaseR( theNumberOfColumns,
00049                            theName,
00050                            theDescription,
00051                            theColumnNames )
00052     {}
00053 
00054 public:
00055 
00056   /// Get the number of rows in the tuple
00057 
00058     virtual UInt_t rows( ) const = 0;
00059 
00060   /// Get a row at a specified position
00061   /**
00062     * This method has to be implemented by a subclass.
00063     *
00064     * @return the completion status of the operation
00065     *
00066     * Returned status values:
00067     *
00068     *    CdbStatus::Success - successfull completion. The vector passed as a parameter
00069     *                         will be filled exactly the same number of elements as
00070     *                         the number of columns in the tuple.
00071     *
00072     *    CdbStatus::NotFound - a row with specified number is not found. The vector passed
00073     *                          as a parameter won't be modified.
00074     *
00075     *    CdbStatus::* - any other problem occured preventing the successfull completion
00076     *                   of the operation. The vector passed as a parameter won't be modified.
00077     *
00078     * Also see the RESTRICTIONS section at the defintion of the class for more
00079     * detailed information on values of parameters.
00080     *
00081     */
00082     virtual CdbStatus get_row( std::vector<E>& theRow,
00083                                const UInt_t    theNumber ) const = 0;
00084 
00085   /// Append a row by the end of an existing list
00086   /**
00087     * This method has to be implemented by a subclass.
00088     *
00089     * @return the completion status of the operation
00090     *
00091     * Returned status values:
00092     *
00093     *    CdbStatus::Success - successfull completion. The vector passed as a parameter
00094     *                         will be filled exactly the same number of elements as
00095     *                         the number of columns in the tuple.
00096     *
00097     *    CdbStatus::IllegalParameters - an incomplete row with wrong number of elements passed
00098     *                                   to the method. The number of elements must match
00099     *                                   the number of columns.
00100     *
00101     *    CdbStatus::* - any other problem occured preventing the successfull completion
00102     *                   of the operation. The vector passed as a parameter won't be modified.
00103     *
00104     * Also see the RESTRICTIONS section at the defintion of the class for more
00105     * detailed information on values of parameters.
00106     */
00107     virtual CdbStatus append_row( const std::vector<E>& theRow ) = 0;
00108 
00109     ClassDefT(CdbRooNTupleR<E>,1);
00110 };
00111 
00112 #endif /* CDBROOTABLE_NTUPLE_R_RDL */

Generated on Mon Dec 5 18:22:09 2005 for CDB by doxygen1.3-rc3