OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
fieldtime.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_FIELDTIME_HPP__
10 #define CMZN_FIELDTIME_HPP__
11 
12 #include "zinc/fieldtime.h"
13 #include "zinc/field.hpp"
14 #include "zinc/timekeeper.hpp"
15 
16 namespace OpenCMISS
17 {
18 namespace Zinc
19 {
20 class FieldTimeLookup : public Field
29 {
30 private:
31  // takes ownership of C handle, responsibility for destroying it
32  explicit FieldTimeLookup(cmzn_field_id field_id) : Field(field_id)
33  { }
34 
35  friend FieldTimeLookup Fieldmodule::createFieldTimeLookup(const Field& sourceField,
36  const Field& timeField);
37 
38 public:
39 
40  FieldTimeLookup() : Field(0)
41  { }
42 
43 };
44 class FieldTimeValue : public Field
51 {
52 private:
53  // takes ownership of C handle, responsibility for destroying it
54  explicit FieldTimeValue(cmzn_field_id field_id) : Field(field_id)
55  { }
56 
57  friend FieldTimeValue Fieldmodule::createFieldTimeValue(const Timekeeper& timeKeeper);
58 
59 public:
60 
61  FieldTimeValue() : Field(0)
62  { }
63 
64 };
65 
66 inline FieldTimeLookup Fieldmodule::createFieldTimeLookup(const Field& sourceField, const Field& timeField)
67 {
68  return FieldTimeLookup(cmzn_fieldmodule_create_field_time_lookup(id,
69  sourceField.getId(), timeField.getId()));
70 }
71 
73 {
74  return FieldTimeValue(cmzn_fieldmodule_create_field_time_value(id, timeKeeper.getId()));
75 }
76 
77 } // namespace Zinc
78 }
79 
80 #endif /* CMZN_FIELDTIME_HPP__ */
FieldTimeLookup createFieldTimeLookup(const Field &sourceField, const Field &timeField)
Definition: fieldtime.hpp:66
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
A field whose value equals the source_field evaluated at the time given by time_field, overriding any time prescribed for field evaluation.
Definition: fieldtime.hpp:28
FieldTimeValue createFieldTimeValue(const Timekeeper &timeKeeper)
Definition: fieldtime.hpp:72
cmzn_timekeeper_id getId() const
Definition: timekeeper.hpp:109
cmzn_field_id getId() const
Definition: field.hpp:98
The timekeeper synchronises a current time across Zinc objects.
Definition: timekeeper.hpp:41
A field which returns the current time from the supplied time keeper.
Definition: fieldtime.hpp:50