OpenCMISS-Zinc C++ API Documentation
differentialoperator.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_DIFFFERENTIALOPERATOR_HPP__
10 #define CMZN_DIFFFERENTIALOPERATOR_HPP__
11 
12 #include "opencmiss/zinc/differentialoperator.h"
13 
14 namespace OpenCMISS
15 {
16 namespace Zinc
17 {
18 
27 {
28 private:
29  cmzn_differentialoperator_id id;
30 
31 public:
32 
33  Differentialoperator() : id(0)
34  { }
35 
36  // takes ownership of C handle, responsibility for destroying it
37  explicit Differentialoperator(cmzn_differentialoperator_id in_differential_operator_id) :
38  id(in_differential_operator_id)
39  { }
40 
41  Differentialoperator(const Differentialoperator& differentialOperator) :
42  id(cmzn_differentialoperator_access(differentialOperator.id))
43  { }
44 
45  Differentialoperator& operator=(const Differentialoperator& differentialOperator)
46  {
47  cmzn_differentialoperator_id temp_id = cmzn_differentialoperator_access(differentialOperator.id);
48  if (0 != id)
49  {
50  cmzn_differentialoperator_destroy(&id);
51  }
52  id = temp_id;
53  return *this;
54  }
55 
57  {
58  if (0 != id)
59  {
60  cmzn_differentialoperator_destroy(&id);
61  }
62  }
63 
69  bool isValid() const
70  {
71  return (0 != id);
72  }
73 
79  cmzn_differentialoperator_id getId() const
80  {
81  return id;
82  }
83 };
84 
85 } // namespace Zinc
86 }
87 
88 #endif /* CMZN_DIFFFERENTIAL_OPERATOR_HPP__ */
Describes the derivative of a field to evaluate.
Definition: differentialoperator.hpp:26
cmzn_differentialoperator_id getId() const
Definition: differentialoperator.hpp:79
The OpenCMISS namespace.
Definition: context.hpp:20
bool isValid() const
Definition: differentialoperator.hpp:69