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
-
using
iterator
= std::vector::iterator¶ Iteration over all fields.
-
using
const_iterator
= std::vector::const_iterator¶ Const iteration over all fields.
Public Functions
-
FieldGroup
()¶
-
FieldGroup
(const FieldGroup &other)¶
-
FieldGroup
(FieldGroup &&other)¶
-
FieldGroup &
operator=
(const FieldGroup &other)¶
-
FieldGroup &
operator=
(FieldGroup &&other)¶
-
FieldGroup
(Vector2D &v)¶ Constructor with a single Vector2D
v
This is needed so that fvec only contains Field2D or Field3D
-
FieldGroup
(Vector3D &v)¶ Constructor with a single Vector3D
v
This is needed so that fvec only contains Field2D or Field3D
-
template<typename ...
Ts
>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.
-
void
add
(const FieldGroup &other)¶ Copy contents of another FieldGroup
other
into this group.
-
FieldGroup &
operator+=
(const FieldGroup &other)¶ Add the contents of
other
to this.
-
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.
-
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.
-
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
>
voidadd
(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.
-
int
size
() const¶ Return number of fields.
-
int
size_field3d
() const¶ Return number of Field3Ds.
-
bool
empty
() const¶ Test whether this group is empty.
-
void
clear
()¶ Remove all fields from this group.
-
const_iterator
begin
() const¶
-
const_iterator
end
() const¶
-
void
makeUnique
()¶ Ensure that each field appears only once.
-
using