aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Component.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-12 22:45:12 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-12 22:45:12 +0100
commit23196be83778973d9688cc5d465e4e4a16476568 (patch)
tree91dee3b2c2e05d3b529cf537d12a7faf7ec21dc1 /src/crepe/Component.h
parent297d621987c224db26eadfb9bde9235741387496 (diff)
add documentation
Diffstat (limited to 'src/crepe/Component.h')
-rw-r--r--src/crepe/Component.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/crepe/Component.h b/src/crepe/Component.h
index fc0268c..52e06d5 100644
--- a/src/crepe/Component.h
+++ b/src/crepe/Component.h
@@ -39,10 +39,27 @@ protected:
virtual Component & operator=(Component &&) = delete;
protected:
+ /**
+ * \name ReplayManager (Memento) functions
+ * \{
+ */
+ /**
+ * \brief Save a snapshot of this component's state
+ * \note This function should only be implemented on components that should be saved/restored
+ * by ReplayManager.
+ * \returns Unique pointer to a deep copy of this component
+ */
virtual std::unique_ptr<Component> save() const;
+ //! Copy constructor (used by \c save())
Component(const Component &) = default;
+ /**
+ * \brief Restore this component from a snapshot
+ * \param snapshot Data to fill this component with (as returned by \c save())
+ */
virtual void restore(const Component & snapshot);
+ //! Copy assignment operator (used by \c restore())
virtual Component & operator=(const Component &);
+ //! \}
public:
virtual ~Component() = default;