From 7fe47a9d5b1727a61dc724523b530762f6d6ba19 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 30 Jun 2022 21:38:53 -0700 Subject: Restructure project --- app/source/Cplt/Model/Workflow/Values/List.hpp | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 app/source/Cplt/Model/Workflow/Values/List.hpp (limited to 'app/source/Cplt/Model/Workflow/Values/List.hpp') diff --git a/app/source/Cplt/Model/Workflow/Values/List.hpp b/app/source/Cplt/Model/Workflow/Values/List.hpp new file mode 100644 index 0000000..cc8e061 --- /dev/null +++ b/app/source/Cplt/Model/Workflow/Values/List.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include + +#include +#include + +class ListValue : public BaseValue +{ +public: + class Iterator + { + private: + std::vector>::iterator mIter; + + public: + BaseValue* operator*() const; + BaseValue* operator->() const; + + Iterator& operator++(); + Iterator operator++(int) const; + Iterator& operator--(); + Iterator operator--(int) const; + + friend bool operator==(const Iterator& a, const Iterator& b); + + private: + friend class ListValue; + Iterator(decltype(mIter) iter); + }; + +private: + std::vector> mElements; + +public: + static bool IsInstance(const BaseValue* value); + ListValue(); + + int GetCount() const; + BaseValue* GetElement(int i) const; + + void Append(std::unique_ptr element); + void Insert(int i, std::unique_ptr element); + void Insert(Iterator iter, std::unique_ptr element); + void Remove(int i); + void Remove(Iterator iter); + + Iterator begin(); + Iterator end(); +}; -- cgit v1.2.3-70-g09d2