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

HistogramSvc.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GaudiSvc/src/HistogramSvc/HistogramSvc.h,v 1.1.1.3 2001/04/18 18:32:50 tlindner Exp $
00002 #ifndef HISTOGRAMSVC_HISTOGRAMSVC_H
00003 #define HISTOGRAMSVC_HISTOGRAMSVC_H
00004 
00005 
00006 // Include Files
00007 #include "GaudiKernel/DataSvc.h"
00008 #include "GaudiKernel/IHistogramSvc.h"
00009 
00010 
00011 // Forward declarations
00012 template <class TYPE> class SvcFactory;
00013 class IHistogram;
00014 class IHistogram1D;
00015 class IHistogram2D;
00016 
00017 
00018 //--------------------------------------------------------------------------
00019 //
00020 // ClassName:   HistogramSvc 
00021 //  
00022 // Description: 
00023 //
00024 // Author:      Pavel Binko
00025 //
00026 //--------------------------------------------------------------------------
00027 
00028 
00029 class HistogramSvc : public DataSvc, virtual public IHistogramSvc {
00030   
00031   friend class SvcFactory<HistogramSvc>;
00032 
00033 protected:
00035   HistogramSvc(
00036     const std::string& name,    // service name
00037     ISvcLocator* svc            // pointer to service locator interface
00038   );
00039 
00041   virtual ~HistogramSvc();
00042 
00043 public:
00045   virtual StatusCode initialize();
00046 
00048   virtual StatusCode queryInterface(
00049     const IID& riid,        // requested interface ID
00050     void** ppvInterface     // pointer to requested interface
00051   );                        // returns StatusCode (SUCCESS or FAILURE)
00052 
00074 
00075 
00079 
00080   virtual IHistogram1D* book( const std::string& fullPath,
00081                           const std::string& title,
00082                           int binsX, double lowX, double highX );
00083   virtual IHistogram1D* book( const std::string& dirPath,
00084                           const std::string& relPath,
00085                           const std::string& title,
00086                           int binsX, double lowX, double highX );
00087   virtual IHistogram1D* book( const std::string& dirPath,
00088                           int hID,
00089                           const std::string& title,
00090                           int binsX, double lowX, double highX );
00091   virtual IHistogram1D* book( DataObject* pParent,
00092                           const std::string& relPath,
00093                           const std::string& title,
00094                           int binsX, double lowX, double highX );
00095   virtual IHistogram1D* book( DataObject* pParent,
00096                           int hID,
00097                           const std::string& title,
00098                           int binsX, double lowX, double highX );
00099 
00100 
00104 
00105   virtual IHistogram1D* book( const std::string& fullPath,
00106                               const std::string& title,
00107                               std::vector<double> edges );
00108   virtual IHistogram1D* book( const std::string& dirPath,
00109                               const std::string& relPath,
00110                               const std::string& title,
00111                               std::vector<double> edges );
00112   virtual IHistogram1D* book( const std::string& dirPath,
00113                               int hID,
00114                               const std::string& title,
00115                               std::vector<double> edges );
00116   virtual IHistogram1D* book( DataObject* pParent,
00117                               const std::string& relPath,
00118                               const std::string& title,
00119                               std::vector<double> edges );
00120   virtual IHistogram1D* book( DataObject* pParent,
00121                               int hID,
00122                               const std::string& title,
00123                               std::vector<double> edges );
00124 
00125 
00129 
00130   virtual IHistogram2D* book( const std::string& fullPath,
00131                               const std::string& title,
00132                               int binsX, double lowX, double highX,
00133                               int binsY, double lowY, double highY );
00134   virtual IHistogram2D* book( const std::string& dirPath,
00135                               const std::string& relPath,
00136                               const std::string& title,
00137                               int binsX, double lowX, double highX,
00138                               int binsY, double lowY, double highY );
00139   virtual IHistogram2D* book( const std::string& dirPath,
00140                               int hID,
00141                               const std::string& title,
00142                               int binsX, double lowX, double highX,
00143                               int binsY, double lowY, double highY );
00144   virtual IHistogram2D* book( DataObject* pParent,
00145                               const std::string& relPath,
00146                               const std::string& title,
00147                               int binsX, double lowX, double highX,
00148                               int binsY, double lowY, double highY );
00149   virtual IHistogram2D* book( DataObject* pParent,
00150                               int hID,
00151                               const std::string& title,
00152                               int binsX, double lowX, double highX,
00153                               int binsY, double lowY, double highY );
00154 
00155 
00159 
00160   virtual StatusCode registerObject( const std::string& fullPath,
00161                                      IHistogram* hObj );
00163   virtual StatusCode registerObject( const std::string& parentPath,
00164                                      const std::string& objPath,
00165                                      IHistogram* hObj );
00167   virtual StatusCode registerObject( const std::string& parentPath,
00168                                      int item,
00169                                      IHistogram* hObj );
00171   virtual StatusCode registerObject( DataObject* parentObj,
00172                                      const std::string& objPath,
00173                                      IHistogram* hObj );
00174   virtual StatusCode registerObject( IHistogram* parentObj,
00175                                      const std::string& objPath,
00176                                      IHistogram* hObj );
00178   virtual StatusCode registerObject( DataObject* parentObj,
00179                                      int item,
00180                                      IHistogram* hObj );
00181   virtual StatusCode registerObject( IHistogram* parentObj,
00182                                      int item,
00183                                      IHistogram* hObj );
00184 
00185 
00189 
00190   virtual StatusCode unregisterObject( IHistogram* hObj );
00192   virtual StatusCode unregisterObject( IHistogram* hObj,
00193                                        const std::string& objectPath );
00195   virtual StatusCode unregisterObject( IHistogram* hObj,
00196                                        int item );
00197 
00198 
00202 
00203   virtual StatusCode retrieveObject( IDataDirectory* pDirectory,
00204                                      const std::string& path,
00205                                      IHistogram1D*& h1dObj );
00206   virtual StatusCode retrieveObject( IDataDirectory* pDirectory,
00207                                      const std::string& path,
00208                                      IHistogram2D*& h2dObj );
00210   virtual StatusCode retrieveObject( const std::string& fullPath,
00211                                      IHistogram1D*& h1dObj );
00212   virtual StatusCode retrieveObject( const std::string& fullPath,
00213                                      IHistogram2D*& h2dObj );
00215   virtual StatusCode retrieveObject( const std::string& parentPath,
00216                                      const std::string& objPath,
00217                                      IHistogram1D*& h1dObj );
00218   virtual StatusCode retrieveObject( const std::string& parentPath,
00219                                      const std::string& objPath,
00220                                      IHistogram2D*& h2dObj );
00222   virtual StatusCode retrieveObject( const std::string& parentPath,
00223                                      int item, 
00224                                      IHistogram1D*& h1dObj );
00225   virtual StatusCode retrieveObject( const std::string& parentPath,
00226                                      int item, 
00227                                      IHistogram2D*& h2dObj );
00229   virtual StatusCode retrieveObject( DataObject* parentObj,
00230                                      const std::string& objPath,
00231                                      IHistogram1D*& h1dObj );
00232   virtual StatusCode retrieveObject( DataObject* parentObj,
00233                                      const std::string& objPath,
00234                                      IHistogram2D*& h2dObj );
00235   virtual StatusCode retrieveObject( IHistogram* parentObj,
00236                                      const std::string& objPath,
00237                                      IHistogram1D*& h1dObj );
00238   virtual StatusCode retrieveObject( IHistogram* parentObj,
00239                                      const std::string& objPath,
00240                                      IHistogram2D*& h2dObj );
00242   virtual StatusCode retrieveObject( DataObject* parentObj,
00243                                      int item,
00244                                      IHistogram1D*& h1dObj );
00245   virtual StatusCode retrieveObject( DataObject* parentObj,
00246                                      int item,
00247                                      IHistogram2D*& h2dObj );
00248   virtual StatusCode retrieveObject( IHistogram* parentObj,
00249                                      int item,
00250                                      IHistogram1D*& h1dObj );
00251   virtual StatusCode retrieveObject( IHistogram* parentObj,
00252                                      int item,
00253                                      IHistogram2D*& h2dObj );
00254 
00255 
00259 
00260   virtual StatusCode findObject( const std::string& fullPath,
00261                                  IHistogram1D*& h1dObj );
00262   virtual StatusCode findObject( const std::string& fullPath,
00263                                  IHistogram2D*& h2dObj );
00265   virtual StatusCode findObject( IDataDirectory* pDirectory,
00266                                  const std::string& path,
00267                                  IHistogram1D*& h1dObj );
00268   virtual StatusCode findObject( IDataDirectory* pDirectory,
00269                                  const std::string& path,
00270                                  IHistogram2D*& h2dObj );
00272   virtual StatusCode findObject( const std::string& parentPath,
00273                                  const std::string& objPath,
00274                                  IHistogram1D*& h1dObj );
00275   virtual StatusCode findObject( const std::string& parentPath,
00276                                  const std::string& objPath,
00277                                  IHistogram2D*& h2dObj );
00279   virtual StatusCode findObject( const std::string& parentPath,
00280                                  int item,
00281                                  IHistogram1D*& h1dObj );
00282   virtual StatusCode findObject( const std::string& parentPath,
00283                                  int item,
00284                                  IHistogram2D*& h2dObj );
00286   virtual StatusCode findObject( DataObject* parentObj,
00287                                  const std::string& objPath,
00288                                  IHistogram1D*& h1dObj );
00289   virtual StatusCode findObject( DataObject* parentObj,
00290                                  const std::string& objPath,
00291                                  IHistogram2D*& h2dObj );
00292   virtual StatusCode findObject( IHistogram* parentObj,
00293                                  const std::string& objPath,
00294                                  IHistogram1D*& h1dObj );
00295   virtual StatusCode findObject( IHistogram* parentObj,
00296                                  const std::string& objPath,
00297                                  IHistogram2D*& h2dObj );
00299   virtual StatusCode findObject( DataObject* parentObj,
00300                                  int item,
00301                                  IHistogram1D*& h1dObj );
00302   virtual StatusCode findObject( DataObject* parentObj,
00303                                  int item,
00304                                  IHistogram2D*& h2dObj );
00305   virtual StatusCode findObject( IHistogram* parentObj,
00306                                  int item,
00307                                  IHistogram1D*& h1dObj );
00308   virtual StatusCode findObject( IHistogram* parentObj,
00309                                  int item,
00310                                  IHistogram2D*& h2dObj );
00311 
00312   //------------------------------------------------------------------------------
00313   // Re-implementing these here avoids a compiler warning about hidden
00314   // functions. Refer to ARM Page 210.
00315   // Register object with the data store.
00316   virtual StatusCode registerObject( const std::string& fullPath, DataObject* pObject ) {
00317     return DataSvc::registerObject( fullPath, pObject );
00318   }
00319 
00321   virtual StatusCode registerObject( const std::string& parentPath, const std::string& objPath, DataObject* pObject ) {
00322     return DataSvc::registerObject( parentPath, objPath, pObject );
00323   }
00324 
00326   virtual StatusCode registerObject( const std::string& parentPath, int item, DataObject* pObject ) {
00327     return DataSvc::registerObject( parentPath, item, pObject );
00328   }
00329 
00331   virtual StatusCode registerObject( DataObject* parentObj, const std::string& objPath, DataObject* pObject ) {
00332     return DataSvc::registerObject( parentObj, objPath, pObject );
00333   }
00334 
00336   virtual StatusCode registerObject( DataObject* parentObj, int item, DataObject* pObject ) {
00337     return DataSvc::registerObject( parentObj, item, pObject );
00338   }
00339 
00341   virtual StatusCode unregisterObject( const std::string& fullPath ) {
00342     return DataSvc::unregisterObject( fullPath );
00343   }
00344 
00346   virtual StatusCode unregisterObject( const std::string& parentPath, const std::string& objectPath ) {
00347     return DataSvc::unregisterObject( parentPath, objectPath );
00348   }
00349 
00351   virtual StatusCode unregisterObject( const std::string& parentPath, int item ) {
00352     return DataSvc::unregisterObject( parentPath, item );
00353   }
00354 
00356   virtual StatusCode unregisterObject( DataObject* pObject ) {
00357     return DataSvc::unregisterObject( pObject );
00358   }
00359 
00361   virtual StatusCode unregisterObject( DataObject* pObject, const std::string& objectPath ) {
00362     return DataSvc::unregisterObject( pObject, objectPath );
00363   }
00364 
00366   virtual StatusCode unregisterObject( DataObject* pObject, int item ) {
00367     return DataSvc::unregisterObject( pObject, item );
00368   }
00369 
00371   virtual StatusCode retrieveObject( IDataDirectory* pDirectory, const std::string& path, DataObject*& pObject ) {
00372     return DataSvc::retrieveObject( pDirectory, path, pObject );
00373   }
00374 
00376   virtual StatusCode retrieveObject( const std::string& fullPath, DataObject*& pObject ) {
00377     return DataSvc::retrieveObject( fullPath, pObject );
00378   }
00379 
00381   virtual StatusCode retrieveObject( const std::string& parentPath, const std::string& objPath, DataObject*& pObject ) {
00382     return DataSvc::retrieveObject( parentPath, objPath, pObject );
00383   }
00384 
00386   virtual StatusCode retrieveObject( const std::string& parentPath, int item, DataObject*& pObject ) {
00387     return DataSvc::retrieveObject( parentPath, item, pObject );
00388   }
00389 
00391   virtual StatusCode retrieveObject( DataObject* parentObj, const std::string& objPath, DataObject*& pObject ) {
00392     return DataSvc::retrieveObject( parentObj, objPath, pObject );
00393   }
00394 
00396   virtual StatusCode retrieveObject( DataObject* parentObj, int item, DataObject*& pObject ) {
00397     return DataSvc::retrieveObject( parentObj, item, pObject );
00398   }
00399 
00401   virtual StatusCode findObject( const std::string& fullPath, DataObject*& pObject ) {
00402     return DataSvc::findObject( fullPath, pObject );
00403   }
00404 
00406   virtual StatusCode findObject( IDataDirectory* pDirectory, const std::string& path, DataObject*& pObject ) {
00407     return DataSvc::findObject( pDirectory, path, pObject );
00408   }
00409 
00411   virtual StatusCode findObject( const std::string& parentPath, const std::string& objPath, DataObject*& pObject ) {
00412     return DataSvc::findObject( parentPath, objPath, pObject );
00413   }
00414 
00416   virtual StatusCode findObject( const std::string& parentPath, int item, DataObject*& pObject ) {
00417     return DataSvc::findObject( parentPath, item, pObject );
00418   }
00419 
00421   virtual StatusCode findObject( DataObject* parentObj, const std::string& objPath, DataObject*& pObject ) {
00422     return DataSvc::findObject( parentObj, objPath, pObject );
00423   }
00424 
00426   virtual StatusCode findObject( DataObject* parentObj, int item, DataObject*& pObject ) {
00427     return DataSvc::findObject( parentObj, item, pObject );
00428   }
00429 
00433 
00436   
00438   virtual std::ostream& print( IHistogram* h,
00439                                std::ostream& s = std::cout) const;
00440 
00443 
00445   virtual std::ostream& write( IHistogram* h,
00446                                std::ostream& s = std::cout) const;
00447 
00449   virtual int write( IHistogram* h, const char* file_name ) const;
00450 
00451 
00455 
00456   virtual DataObject* createPath( const std::string& newPath );
00457 
00459   virtual DataObject* createDirectory  (
00460     const std::string& parentDir,     // name of the parent directory
00461     const std::string& subDir         // to identify the histogram object in the store
00462   );                                  // returns pointer to DataObject (NULL on failure)
00463 
00464 };
00465 
00466 
00467 #endif    // HISTOGRAMSVC_HISTOGRAMSVC_H

Generated at Wed Nov 21 12:22:30 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000