CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DetectorDescription/Core/interface/DDQuery.h

Go to the documentation of this file.
00001 #ifndef DDCore_DDQuery_h
00002 #define DDCore_DDQuery_h
00003 
00004 #include "DetectorDescription/Core/interface/DDExpandedView.h"
00005 #include "DetectorDescription/Core/interface/DDFilter.h"
00006 #include "DetectorDescription/Core/interface/DDScope.h"
00007 
00008 #include <map>
00009 #include <vector>
00010 #include <utility>
00011 
00012 //class DDCompactView;
00013 
00015 class DDQuery
00016 {
00017 public:
00018   enum log_op { AND, OR };
00020   DDQuery(const DDCompactView &);
00021   
00022   virtual ~DDQuery();
00023   
00024   virtual const std::vector<DDExpandedNode> & exec();
00025   
00026   virtual void addFilter(const DDFilter &, log_op op=AND);
00027   
00028   virtual void setScope(const DDScope &);
00029   
00030   //void composeQuery(const DDQuery &);
00031   
00032 protected:
00033   //const DDCompactView & cpv_;
00034   DDExpandedView epv_;  
00035   const DDScope * scope_;
00036   typedef std::pair<bool, DDFilter *> criterion_type;
00037   typedef std::vector<criterion_type> criteria_type;
00038   typedef std::vector<log_op> logops_type;
00039   
00040   criteria_type criteria_; // one filter and the result on the current node
00041   logops_type logOps_; // logical operation for merging the result of 2 filters
00042   
00043   std::vector<DDExpandedNode> result_; // query result
00044 };
00045 
00046 #endif