OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
fieldlogicaloperators.hpp
Go to the documentation of this file.
1 
4 /* OpenCMISS-Zinc Library
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #ifndef CMZN_FIELDLOGICALOPERATORS_HPP__
10 #define CMZN_FIELDLOGICALOPERATORS_HPP__
11 
12 #include "zinc/fieldlogicaloperators.h"
13 #include "zinc/field.hpp"
14 #include "zinc/fieldmodule.hpp"
15 
16 namespace OpenCMISS
17 {
18 namespace Zinc
19 {
20 class FieldAnd : public Field
30 {
31 private:
32  // takes ownership of C handle, responsibility for destroying it
33  explicit FieldAnd(cmzn_field_id field_id) : Field(field_id)
34  { }
35 
36  friend FieldAnd Fieldmodule::createFieldAnd(const Field& sourceField1,
37  const Field& sourceField2);
38 
39 public:
40 
41  FieldAnd() : Field(0)
42  { }
43 
44 };
45 
46 inline FieldAnd operator&&(const Field& operand1, const Field& operand2)
47 {
48  return operand1.getFieldmodule().createFieldAnd(operand1, operand2);
49 }
50 class FieldEqualTo : public Field
60 {
61 private:
62  // takes ownership of C handle, responsibility for destroying it
63  explicit FieldEqualTo(cmzn_field_id field_id) : Field(field_id)
64  { }
65 
66  friend FieldEqualTo Fieldmodule::createFieldEqualTo(const Field& sourceField1,
67  const Field& sourceField2);
68 
69 public:
70 
71  FieldEqualTo() : Field(0)
72  { }
73 
74 };
75 class FieldGreaterThan : public Field
85 {
86 private:
87  // takes ownership of C handle, responsibility for destroying it
88  explicit FieldGreaterThan(cmzn_field_id field_id) : Field(field_id)
89  { }
90 
91  friend FieldGreaterThan Fieldmodule::createFieldGreaterThan(const Field& sourceField1,
92  const Field& sourceField2);
93 
94 public:
95 
96  FieldGreaterThan() : Field(0)
97  { }
98 
99 };
100 
101 inline FieldGreaterThan operator>(const Field& operand1, const Field& operand2)
102 {
103  return operand1.getFieldmodule().createFieldGreaterThan(operand1, operand2);
104 }
105 class FieldLessThan : public Field
115 {
116 private:
117  // takes ownership of C handle, responsibility for destroying it
118  explicit FieldLessThan(cmzn_field_id field_id) : Field(field_id)
119  { }
120 
121  friend FieldLessThan Fieldmodule::createFieldLessThan(const Field& sourceField1, const Field& sourceField2);
122 
123 public:
124 
125  FieldLessThan() : Field(0)
126  { }
127 
128 };
129 
130 inline FieldLessThan operator<(const Field& operand1, const Field& operand2)
131 {
132  return operand1.getFieldmodule().createFieldLessThan(operand1, operand2);
133 }
134 class FieldOr : public Field
144 {
145 private:
146  // takes ownership of C handle, responsibility for destroying it
147  explicit FieldOr(cmzn_field_id field_id) : Field(field_id)
148  { }
149 
150  friend FieldOr Fieldmodule::createFieldOr(const Field& sourceField1,
151  const Field& sourceField2);
152 
153 public:
154 
155  FieldOr() : Field(0)
156  { }
157 
158 };
159 
160 inline FieldOr operator||(const Field& operand1, const Field& operand2)
161 {
162  return operand1.getFieldmodule().createFieldOr(operand1, operand2);
163 }
164 class FieldNot : public Field
175 {
176 private:
177  // takes ownership of C handle, responsibility for destroying it
178  explicit FieldNot(cmzn_field_id field_id) : Field(field_id)
179  { }
180 
181  friend FieldNot Fieldmodule::createFieldNot(const Field& sourceField);
182 
183 public:
184 
185  FieldNot() : Field(0)
186  { }
187 
188 };
189 
190 inline FieldNot operator!(const Field& operand)
191 {
192  return operand.getFieldmodule().createFieldNot(operand);
193 }
194 class FieldXor : public Field
204 {
205 private:
206  // takes ownership of C handle, responsibility for destroying it
207  explicit FieldXor(cmzn_field_id field_id) : Field(field_id)
208  { }
209 
210  friend FieldXor Fieldmodule::createFieldXor(const Field& sourceField1,
211  const Field& sourceField2);
212 
213 public:
214 
215  FieldXor() : Field(0)
216  { }
217 
218 };
219 
220 inline FieldAnd Fieldmodule::createFieldAnd(const Field& sourceField1, const Field& sourceField2)
221 {
222  return FieldAnd(cmzn_fieldmodule_create_field_and(id,
223  sourceField1.getId(), sourceField2.getId()));
224 }
225 
226 inline FieldEqualTo Fieldmodule::createFieldEqualTo(const Field& sourceField1, const Field& sourceField2)
227 {
228  return FieldEqualTo(cmzn_fieldmodule_create_field_equal_to(id,
229  sourceField1.getId(), sourceField2.getId()));
230 }
231 
232 inline FieldGreaterThan Fieldmodule::createFieldGreaterThan(const Field& sourceField1, const Field& sourceField2)
233 {
234  return FieldGreaterThan(cmzn_fieldmodule_create_field_greater_than(id,
235  sourceField1.getId(), sourceField2.getId()));
236 }
237 
238 inline FieldLessThan Fieldmodule::createFieldLessThan(const Field& sourceField1, const Field& sourceField2)
239 {
240  return FieldLessThan(cmzn_fieldmodule_create_field_less_than(id,
241  sourceField1.getId(), sourceField2.getId()));
242 }
243 
244 inline FieldOr Fieldmodule::createFieldOr(const Field& sourceField1, const Field& sourceField2)
245 {
246  return FieldOr(cmzn_fieldmodule_create_field_or(id,
247  sourceField1.getId(), sourceField2.getId()));
248 }
249 
250 inline FieldNot Fieldmodule::createFieldNot(const Field& sourceField)
251 {
252  return FieldNot(cmzn_fieldmodule_create_field_not(id, sourceField.getId()));
253 }
254 
255 inline FieldXor Fieldmodule::createFieldXor(const Field& sourceField1, const Field& sourceField2)
256 {
257  return FieldXor(cmzn_fieldmodule_create_field_xor(id,
258  sourceField1.getId(), sourceField2.getId()));
259 }
260 
261 } // namespace Zinc
262 }
263 
264 #endif
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
FieldAnd createFieldAnd(const Field &sourceField1, const Field &sourceField2)
Definition: fieldlogicaloperators.hpp:220
FieldNot createFieldNot(const Field &sourceField)
Definition: fieldlogicaloperators.hpp:250
A field whose component values are 1 if that component of source_field_one OR source_field_two is non...
Definition: fieldlogicaloperators.hpp:203
FieldOr createFieldOr(const Field &sourceField1, const Field &sourceField2)
Definition: fieldlogicaloperators.hpp:244
cmzn_field_id getId() const
Definition: field.hpp:98
A field whose component values are 1 if that component of source_field_one AND source_field_two is no...
Definition: fieldlogicaloperators.hpp:29
A field whose component values are 1 if that component of source_field_one is less than the component...
Definition: fieldlogicaloperators.hpp:114
FieldXor createFieldXor(const Field &sourceField1, const Field &sourceField2)
Definition: fieldlogicaloperators.hpp:255
A field whose component values are 1 if that component of the source_field is zero, 0 otherwise; effectively a component-wise logical not operator.
Definition: fieldlogicaloperators.hpp:174
A field whose component values are 1 if that component of source_field_one EQUALS that component of s...
Definition: fieldlogicaloperators.hpp:59
FieldLessThan createFieldLessThan(const Field &sourceField1, const Field &sourceField2)
Definition: fieldlogicaloperators.hpp:238
FieldGreaterThan createFieldGreaterThan(const Field &sourceField1, const Field &sourceField2)
Definition: fieldlogicaloperators.hpp:232
A field whose component values are 1 if that component of source_field_one is greater than the compon...
Definition: fieldlogicaloperators.hpp:84
A field whose component values are 1 if that component of source_field_one OR source_field_two is non...
Definition: fieldlogicaloperators.hpp:143
FieldEqualTo createFieldEqualTo(const Field &sourceField1, const Field &sourceField2)
Definition: fieldlogicaloperators.hpp:226
Fieldmodule getFieldmodule() const
Definition: fieldmodule.hpp:1572