Commits

Anonymous committed bb9860a

adding IAthenaRootCnvSvc and IRootSvc interfaces

Comments (0)

Files changed (6)

AthenaRootKernel/IAthenaRootCnvSvc.h

+///////////////////////// -*- C++ -*- /////////////////////////////
+#ifndef ATHENAROOTKERNEL_IATHENAROOTCNVSVC_H
+#define ATHENAROOTKERNEL_IATHENAROOTCNVSVC_H 1
+
+/** @file IAthenaRootCnvSvc.h
+ *  @brief This file contains the class definition for the IAthenaRootCnvSvc interface class.
+ *  @author Peter van Gemmeren <gemmeren@anl.gov>
+ **/
+
+// stl includes
+#include <typeinfo>
+
+// fwk includes
+#include "GaudiKernel/IConversionSvc.h"
+#include "GaudiKernel/IAddressCreator.h"
+
+// Reflex includes
+#include "Reflex/Type.h"
+
+// fwd declares
+class TClass;
+class ITPCnvBase;
+
+/** @class IAthenaRootCnvSvc
+ *  @brief This class provides the interface between Athena and RootSvc.
+ **/
+class IAthenaRootCnvSvc : 
+  virtual public ::IConversionSvc, 
+  virtual public ::IAddressCreator 
+{
+
+public:
+
+   /// Retrieve interface ID
+   static const InterfaceID& interfaceID() 
+  { 
+    /// Declaration of the interface ID 
+    /// ( interface id, major version, minor version)
+    static const InterfaceID s_iid("IAthenaRootCnvSvc", 1, 0);
+    return s_iid; 
+  }
+
+  virtual ~IAthenaRootCnvSvc();
+
+  /// Get T/P converter for a transient class.
+  virtual ITPCnvBase* getTPConverter(const CLID& clid) const = 0;
+
+  ///@{ CINT-based API
+  /// Load the class (dictionary) from Root.
+  virtual TClass* getClass(const CLID& clid) const = 0;
+  virtual TClass* getClass(const std::type_info& type) const = 0;
+
+  /// Write object of a given class to Root, using optional T/P converter.
+  virtual unsigned long writeObject(const std::string& placement,
+                                    TClass* classDesc,
+                                    const void* pObj,
+                                    ITPCnvBase* tpConverter = 0) = 0;
+  ///@}
+
+  ///@{ Reflex-based API
+  /// Load the class (dictionary) from Root.
+  virtual Reflex::Type getType(const CLID& clid) const = 0;
+  virtual Reflex::Type getType(const std::type_info& type) const = 0;
+
+  /// Write object of a given class to Root, using optional T/P converter.
+  virtual 
+  unsigned long writeObject(const std::string& placement,
+                            Reflex::Type typeDesc,
+                            const void* pObj,
+                            ITPCnvBase* tpConverter = 0) = 0;
+  ///@}
+
+};
+
+#endif /* !ATHENAROOTKERNEL_IATHENAROOTCNVSVC_H */
+

AthenaRootKernel/IRootSvc.h

+///////////////////////// -*- C++ -*- /////////////////////////////
+#ifndef ATHENAROOTKERNEL_IROOTSVC_H
+#define ATHENAROOTKERNEL_IROOTSVC_H 1
+
+/** @file IRootSvc.h
+ *  @brief This file contains the class definition for the IRootSvc interface class.
+ *  @author Peter van Gemmeren <gemmeren@anl.gov>
+ **/
+
+// stl includes
+#include <typeinfo>
+#include <string>
+
+// fwk includes
+#include "GaudiKernel/IInterface.h"
+
+// reflex includes
+#include "Reflex/Type.h"
+
+// fwd declares
+class TClass;
+
+/** @class IRootSvc
+ *  @brief This class provides the interface to the ROOT software.
+ **/
+class IRootSvc : virtual public IInterface
+{
+
+public:
+
+  virtual ~IRootSvc();
+
+  /////////////////////////////////////////////////////////////////// 
+  // Public members: 
+  /////////////////////////////////////////////////////////////////// 
+
+  /// Retrieve interface ID
+  static const InterfaceID& interfaceID() 
+  { 
+    static const InterfaceID s_iid("IRootSvc", 1, 0);
+    return s_iid;
+  }
+
+  ///@{ Reflex-base interface
+
+  /// Load the type (dictionary) from Root.
+  virtual 
+  Reflex::Type getType(const std::type_info& type) const = 0;
+
+  /// Create an object of a given `Reflex::Type`.
+  virtual 
+  void* createObject(const Reflex::Type type) const = 0;
+
+  /// Write object of a given class to Root.
+  virtual 
+  unsigned long writeObject(const std::string& placement,
+                            const Reflex::Type type,
+                            const void* pObj) = 0;
+
+  /// Destruct a given object of type `Reflex::Type`.
+  virtual
+  void destructObject(Reflex::Type type, void* pObj) const = 0;
+  
+  ///@}
+
+  ///@{ CINT-base interface
+  /// Load the class (dictionary) from Root.
+  virtual TClass* getClass(const std::type_info& type) const = 0;
+
+  /// Create an object of a given TClass.
+  virtual void* createObject(const TClass* classDesc) const = 0;
+
+  /// Write object of a given class to Root.
+  virtual unsigned long writeObject(const std::string& placement,
+                                    const TClass* classDesc,
+                                    const void* pObj) = 0;
+
+  /// Destructor a given object of TClass.
+  virtual void destructObject(TClass* classDesc, void* pObj) const = 0;
+  
+  ///@}
+
+  /// Connect the file to the service with open mode.
+  virtual StatusCode connect(const std::string& file, 
+                             const std::string& openMode) = 0;
+  
+  /// Commit data and flush buffer.
+  virtual StatusCode commitOutput() = 0;
+  
+  /// Disconnect the file from the service.
+  virtual StatusCode disconnect(const std::string& file) = 0;
+};
+
+#endif /* !ATHENAROOTKERNEL_IROOTSVC_H */
+
+2011-11-28  Sebastien Binet  <sebastien.binet@cern.ch>
+
+	* tagging AthenaRootKernel-00-00-01
+	* adding IAthenaRootCnvSvc and IRootSvc interfaces
+	* A cmt/requirements
+	* A AthenaRootKernel/IAthenaRootCnvSvc.h
+	* A AthenaRootKernel/IRootSvc.h
+	* A src/IAthenaRootCnvSvc.cxx
+	* A src/IRootSvc.cxx
+
 2011-11-25  Sebastien Binet  <sebastien.binet@cern.ch>
 
 	* tagging AthenaRootKernel-00-00-00
+package AthenaRootKernel
+
+author Sebastien Binet <binet@cern.ch>
+author Peter van Gemmeren <gemmeren@anl.gov>
+
+## For Athena policies: it has to be the first use statement
+use AtlasPolicy 	AtlasPolicy-*
+
+
+use GaudiInterface 	GaudiInterface-* 	External
+use AtlasReflex     AtlasReflex-*       External
+
+##
+
+branches src doc python
+
+library AthenaRootKernel *.cxx
+
+apply_pattern installed_library
+
+private
+# for TGraph...
+#macro_append ROOT_linkopts " -lGraf"
+
+end_private

src/IAthenaRootCnvSvc.cxx

+///////////////////////// -*- C++ -*- /////////////////////////////
+// IAthenaRootCnvSvc.cxx 
+// Implementation file for class IAthenaRootCnvSvc
+// Author: S.Binet<binet@cern.ch>
+/////////////////////////////////////////////////////////////////// 
+
+// Gaudi includes
+
+// AthenaRootKernel includes
+#include "AthenaRootKernel/IAthenaRootCnvSvc.h"
+
+// STL includes
+
+/////////////////////////////////////////////////////////////////// 
+// Public methods: 
+/////////////////////////////////////////////////////////////////// 
+
+// Constructors
+////////////////
+
+// Destructor
+///////////////
+IAthenaRootCnvSvc::~IAthenaRootCnvSvc()
+{}
+
+/////////////////////////////////////////////////////////////////// 
+// Const methods: 
+///////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////// 
+// Non-const methods: 
+/////////////////////////////////////////////////////////////////// 
+
+/////////////////////////////////////////////////////////////////// 
+// Protected methods: 
+/////////////////////////////////////////////////////////////////// 
+
+/////////////////////////////////////////////////////////////////// 
+// Const methods: 
+///////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////// 
+// Non-const methods: 
+/////////////////////////////////////////////////////////////////// 
+///////////////////////// -*- C++ -*- /////////////////////////////
+// IRootSvc.cxx 
+// Implementation file for class IRootSvc
+// Author: S.Binet<binet@cern.ch>
+/////////////////////////////////////////////////////////////////// 
+
+// Gaudi includes
+
+// AthenaRootKernel includes
+#include "AthenaRootKernel/IRootSvc.h"
+
+// STL includes
+
+/////////////////////////////////////////////////////////////////// 
+// Public methods: 
+/////////////////////////////////////////////////////////////////// 
+
+// Constructors
+////////////////
+
+// Destructor
+///////////////
+IRootSvc::~IRootSvc()
+{}
+
+/////////////////////////////////////////////////////////////////// 
+// Const methods: 
+///////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////// 
+// Non-const methods: 
+/////////////////////////////////////////////////////////////////// 
+
+/////////////////////////////////////////////////////////////////// 
+// Protected methods: 
+/////////////////////////////////////////////////////////////////// 
+
+/////////////////////////////////////////////////////////////////// 
+// Const methods: 
+///////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////// 
+// Non-const methods: 
+/////////////////////////////////////////////////////////////////// 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.