ScaleOut C++ Native Client API  5.1
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Pages
query_expression.h
1 /*
2  Copyright (c) 2013 by ScaleOut Software, Inc.
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 #pragma once
18 
19 #include <string>
20 #include <boost/shared_ptr.hpp>
21 
22 namespace sosscli {
23 
24 // Forward references...
25 class QueryExpression;
26 class ValueComparand;
27 class ReferenceComparand;
28 
29 namespace internal {
30  class ComparisonExpression;
31  class StringContainsExpression;
32  class AndExpression;
33  class OrExpression;
34  class EqualsExpression;
35  class NotExpression;
36 }
37 
42 {
43 public:
44 
55  class Visitor
56  {
57  public:
59  virtual ~Visitor();
60 
63  virtual void visit(ValueComparand const & v);
64 
67  virtual void visit(ReferenceComparand const & r);
68 
71  virtual void visit(internal::ComparisonExpression const & c);
72 
75  virtual void visit(internal::StringContainsExpression const & s);
76 
79  virtual void visit(internal::AndExpression const & a);
80 
83  virtual void visit(internal::OrExpression const & o);
84 
87  virtual void visit(internal::EqualsExpression const & e);
88 
91  virtual void visit(internal::NotExpression const & n);
92  };
93 
95  enum OpCode
96  {
103  Compare = 1,
104 
107 
109  And,
110 
112  Or,
113 
116 
118  // TODO: not supported yet.
120 
122  // TODO: not supported yet.
124 
127  // TODO: not supported yet
129 
132  };
133 
134 public:
136  virtual ~QueryExpression();
137 
150  virtual void accept(Visitor &v) const = 0;
151 };
152 
153 }