CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDQuery.h
Go to the documentation of this file.
1 #ifndef DDCore_DDQuery_h
2 #define DDCore_DDQuery_h
3 
7 
8 #include <map>
9 #include <vector>
10 #include <utility>
11 
12 //class DDCompactView;
13 
15 class DDQuery
16 {
17 public:
18  enum log_op { AND, OR };
20  DDQuery(const DDCompactView &);
21 
22  virtual ~DDQuery();
23 
24  virtual const std::vector<DDExpandedNode> & exec();
25 
26  virtual void addFilter(const DDFilter &, log_op op=AND);
27 
28  virtual void setScope(const DDScope &);
29 
30  //void composeQuery(const DDQuery &);
31 
32 protected:
33  //const DDCompactView & cpv_;
35  const DDScope * scope_;
36  typedef std::pair<bool, DDFilter *> criterion_type;
37  typedef std::vector<criterion_type> criteria_type;
38  typedef std::vector<log_op> logops_type;
39 
40  criteria_type criteria_; // one filter and the result on the current node
41  logops_type logOps_; // logical operation for merging the result of 2 filters
42 
43  std::vector<DDExpandedNode> result_; // query result
44 };
45 
46 #endif
virtual void addFilter(const DDFilter &, log_op op=AND)
Definition: DDQuery.cc:18
Base class for querying for nodes in the DDExpandedView.
Definition: DDQuery.h:15
std::pair< bool, DDFilter * > criterion_type
Definition: DDQuery.h:36
criteria_type criteria_
Definition: DDQuery.h:40
virtual const std::vector< DDExpandedNode > & exec()
Definition: DDQuery.cc:36
virtual void setScope(const DDScope &)
Definition: DDQuery.cc:30
type of data representation of DDCompactView
Definition: DDCompactView.h:77
std::vector< DDExpandedNode > result_
Definition: DDQuery.h:43
virtual ~DDQuery()
Definition: DDQuery.cc:11
const DDScope * scope_
Definition: DDQuery.h:35
DDQuery(const DDCompactView &)
sets up a query
Definition: DDQuery.cc:6
defines subtrees in the expanded-view
Definition: DDScope.h:26
DDExpandedView epv_
Definition: DDQuery.h:34
A Filter accepts or rejects a DDExpandedNode based on a user-coded decision rule. ...
Definition: DDFilter.h:18
logops_type logOps_
Definition: DDQuery.h:41
std::vector< criterion_type > criteria_type
Definition: DDQuery.h:37
Provides an exploded view of the detector (tree-view)
log_op
Definition: DDQuery.h:18
std::vector< log_op > logops_type
Definition: DDQuery.h:38