Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:23

0001 #ifndef DD_DDALGORITHMHANDLER_H
0002 #define DD_DDALGORITHMHANDLER_H
0003 
0004 #include <string>
0005 
0006 #include "DetectorDescription/Core/interface/DDAlgorithm.h"
0007 #include "DetectorDescription/Core/interface/DDTypes.h"
0008 #include "DetectorDescription/Core/interface/DDLogicalPart.h"
0009 
0010 class DDAlgorithm;
0011 class DDCompactView;
0012 
0013 //! wrapper around a DDAlgorithm
0014 /** used from DDParser for setting up, initializing, and executing an DDAlgorithm */
0015 class DDAlgorithmHandler {
0016 public:
0017   //! creates an DDAlgorithm wrapper
0018   DDAlgorithmHandler() {}
0019 
0020   //! initializes the wrapped algorithm algo_ and does some pre- and post-processing
0021   /** pre- and postprocessing mainly covers exception handling,
0022       the algorithm object algo_ is fetched from the plugin-manager */
0023   void initialize(const DDName& algoName,
0024                   const DDLogicalPart& parent,
0025                   const DDNumericArguments& nArgs,
0026                   const DDVectorArguments& vArgs,
0027                   const DDMapArguments& mArgs,
0028                   const DDStringArguments& sArgs,
0029                   const DDStringVectorArguments& svArgs);
0030 
0031   //! executes the wrapped algorithm algo_; some pre- and post-processing (exception handling)
0032   void execute(DDCompactView&);
0033 
0034 private:
0035   std::unique_ptr<DDAlgorithm> algo_;  //!< the wrapped algorithm object
0036 };
0037 
0038 #endif  //  DD_DDALGORITHMHANDLER_H