aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Items.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/Model/Items.cpp')
-rw-r--r--core/src/Model/Items.cpp83
1 files changed, 83 insertions, 0 deletions
diff --git a/core/src/Model/Items.cpp b/core/src/Model/Items.cpp
new file mode 100644
index 0000000..db2d39f
--- /dev/null
+++ b/core/src/Model/Items.cpp
@@ -0,0 +1,83 @@
+#include "Items.hpp"
+
+#include <limits>
+#include <utility>
+
+ItemBase::ItemBase()
+ : mId{ std::numeric_limits<size_t>::max() } {
+}
+
+ItemBase::ItemBase(size_t id)
+ : mId{ id } {
+}
+
+bool ItemBase::IsInvalid() const {
+ return mId == std::numeric_limits<size_t>::max();
+}
+
+size_t ItemBase::GetId() const {
+ return mId;
+}
+
+ProductItem::ProductItem(size_t id, std::string name)
+ : ItemBase(id)
+ , mName{ std::move(name) } {
+}
+
+const std::string& ProductItem::GetName() const {
+ return mName;
+}
+
+void ProductItem::SetName(std::string name) {
+ mName = std::move(name);
+}
+
+const std::string& ProductItem::GetDescription() const {
+ return mDescription;
+}
+
+void ProductItem::SetDescription(std::string description) {
+ mDescription = std::move(description);
+}
+
+FactoryItem::FactoryItem(size_t id, std::string name)
+ : ItemBase(id)
+ , mName{ std::move(name) } {
+}
+
+const std::string& FactoryItem::GetName() const {
+ return mName;
+}
+
+void FactoryItem::SetName(std::string name) {
+ mName = std::move(name);
+}
+
+const std::string& FactoryItem::GetDescription() const {
+ return mDescription;
+}
+
+void FactoryItem::SetDescription(std::string description) {
+ mDescription = std::move(description);
+}
+
+CustomerItem::CustomerItem(size_t id, std::string name)
+ : ItemBase(id)
+ , mName{ std::move(name) } {
+}
+
+const std::string& CustomerItem::GetName() const {
+ return mName;
+}
+
+void CustomerItem::SetName(std::string name) {
+ mName = std::move(name);
+}
+
+const std::string& CustomerItem::GetDescription() const {
+ return mDescription;
+}
+
+void CustomerItem::SetDescription(std::string description) {
+ mDescription = std::move(description);
+}