gsystem
Loading...
Searching...
No Matches
gmodifier.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4#include <optional>
5#include <string>
6#include <utility>
7
27{
28public:
39 GModifier(std::string n, std::optional<std::string> s, std::optional<std::string> t, bool existence) :
40 name(std::move(n)),
41 shift(std::move(s)),
42 tilts(std::move(t)),
43 isPresent(existence) {
44 }
45
47 GModifier(const GModifier& other) = default;
48
49private:
50 std::string name;
51 std::optional<std::string> shift;
52 std::optional<std::string> tilts;
53 bool isPresent;
54
61 friend std::ostream& operator<<(std::ostream& stream, const GModifier& gm) {
62 stream << "GModifier: " << gm.name << " shift: " << gm.shift.value_or("none")
63 << " tilts: " << gm.tilts.value_or("none") << " isPresent: " << gm.isPresent;
64 return stream;
65 }
66
67public:
69 [[nodiscard]] const std::string& getName() const { return name; }
70
72 [[nodiscard]] const std::optional<std::string>& getShift() const { return shift; }
73
75 [[nodiscard]] const std::optional<std::string>& getTilts() const { return tilts; }
76
78 [[nodiscard]] bool getExistence() const { return isPresent; }
79};
const std::optional< std::string > & getShift() const
Returns the configured shift expression.
Definition gmodifier.h:72
GModifier(const GModifier &other)=default
Default copy constructor (value-object semantics).
bool getExistence() const
Returns whether the target volume should exist in the final world.
Definition gmodifier.h:78
GModifier(std::string n, std::optional< std::string > s, std::optional< std::string > t, bool existence)
Construct a modifier record.
Definition gmodifier.h:39
friend std::ostream & operator<<(std::ostream &stream, const GModifier &gm)
Stream operator for logging/debug printing.
Definition gmodifier.h:61
const std::optional< std::string > & getTilts() const
Returns the configured tilt expression.
Definition gmodifier.h:75
const std::string & getName() const
Returns the modifier target volume name.
Definition gmodifier.h:69