File fieldgroup.hxx#
Functions
-
FieldGroup operator+(const FieldGroup &lhs, const FieldGroup &rhs)
Combine two FieldGroups.
-
class FieldGroup#
- #include <fieldgroup.hxx>
Group together fields for easier communication
Note: The FieldData class is used as a base class, which is inherited by Field2D, Field3D, Vector2D and Vector3D however Vector2D and Vector3D are stored by reference to their components (x,y,z) as Field2D or Field3D objects.
Public Types
Public Functions
-
FieldGroup() = default#
-
FieldGroup(const FieldGroup &other) = default#
-
FieldGroup(FieldGroup &&other) = default#
-
FieldGroup &operator=(const FieldGroup &other) = default#
-
FieldGroup &operator=(FieldGroup &&other) = default#
-
inline FieldGroup(Vector2D &v)#
Constructor with a single Vector2D
v
This is needed so that fvec only contains Field2D or Field3D
-
inline FieldGroup(Vector3D &v)#
Constructor with a single Vector3D
v
This is needed so that fvec only contains Field2D or Field3D
-
template<typename ...Ts>
inline explicit FieldGroup(Ts&... ts)# Variadic constructor. Allows an arbitrary number of FieldData arguments
The explicit keyword prevents FieldGroup being constructed with arbitrary types. In particular arguments to add() cannot be implicitly converted to FieldGroup, leading to an infinite loop.
-
inline void add(const FieldGroup &other)#
Copy contents of another FieldGroup
other
into this group.
-
inline FieldGroup &operator+=(const FieldGroup &other)#
Add the contents of
other
to this.
-
inline void add(FieldData &f)#
Add a FieldData
f
to the group.A pointer to this field will be stored internally, so the lifetime of this variable should be longer than the lifetime of this group.
-
inline void add(Vector2D &v)#
Add a Vector2D
v
to the group.Pointers to this vector’s components will be stored internally, so the lifetime of this variable should be longer than the lifetime of this group.
-
inline void add(Vector3D &v)#
Add a Vector3D
v
to the group.Pointers to this vector’s components will be stored internally, so the lifetime of this variable should be longer than the lifetime of this group.
-
template<typename ...Ts>
inline void add(FieldData &t, Ts&... ts)# Add multiple fields to this group
This is a variadic template which allows Field3D objects to be treated as a special case. An arbitrary number of fields can be added.
-
inline int size() const#
Return number of fields.
-
inline int size_field3d() const#
Return number of Field3Ds.
-
inline bool empty() const#
Test whether this group is empty.
-
inline void clear()#
Remove all fields from this group.
-
inline const_iterator begin() const#
-
inline const_iterator end() const#
-
void makeUnique()#
Ensure that each field appears only once.
-
FieldGroup() = default#