+ typedef DataStructure_ArrayDynamic<AD> self_type;
+
+ size_t growth_;
+
+ public:
+ DataStructure_ArrayDynamic<AD>(size_t capacity = 512) : AbstractDataStructure<AD>(capacity), growth_(512) {};
+
+ virtual self_type* get_begin()
+ {
+ self_type* result = nullptr;
+
+ if (this->size_ > 0) {
+ this->current_ = 0;
+ result = this;
+ }
+ return result;
+ };
+
+ virtual self_type* get_end()
+ {
+ self_type* result = nullptr;
+
+ if (this->size_ > 0)
+ {
+ this->current_ = this->size_ - 1;
+ result = this;
+ }
+ return result;
+ };
+
+ virtual self_type* get_next()
+ {
+ self_type* result = nullptr;
+
+ if (this->size_ > 0)
+ {
+ if (this->current_ + 1 < this->size_)
+ {
+ ++this->current_;
+ result = this;
+ }
+ }
+
+ return result;
+ };
+
+ virtual self_type* get_previous()
+ {
+ self_type* result = nullptr;
+
+ if (this->size_ > 0)
+ {
+ if (this->current_ - 1 >= 0)
+ {
+ --this->current_;
+ result = this;
+ }
+ }
+
+ return result;
+ };
+
+ virtual bool insert_at(AD& data, long index = TAIL)
+ {
+ bool result = false;
+
+ if (this->data_ != nullptr)
+ {
+ if (index == TAIL)
+ index = 0;
+ else if (index == HEAD)
+ index = this->size_;
+
+ if (this->capacity_ <= index)
+ this->grow();
+
+ if (this->capacity_ > index)
+ {
+ this->data_[index] = data;
+
+ if (index >= this->size_)
+ this->size_ = index + 1;
+
+ result = true;
+ }
+ }
+
+ return result;
+ };
+
+ virtual bool remove_at(AD& data, long index = TAIL, bool erase = false)
+ {
+ bool result = false;
+ // TODO: implement
+ return result;
+ };
+
+ virtual bool remove_at(long index = TAIL, bool erase = false)
+ {
+ bool result = false;
+ // TODO: implement
+ return result;
+ };
+
+ virtual bool remove_all(AD& data, bool eraser = false)
+ {
+ bool result = false;
+ // TODO: implement
+ return result;
+ };
+
+ virtual bool replace_at(AD& data_in, AD& data_out, long index = TAIL, bool erase = false)
+ {
+ bool result = false;
+ // TODO: implement
+ return result;
+ };
+
+ virtual bool replace_at(AD& data_in, long index = TAIL, bool erase = false)
+ {
+ bool result = false;
+ // TODO: implement
+ return result;
+ };
+
+ virtual bool replace_all(AD& data_in, AD& data_out, bool erase = false)
+ {
+ bool result = false;
+ // TODO: implement
+ return result;
+ };
+
+ virtual AD* find(AD& needle, AD* last_found = nullptr)
+ {
+ AD* result = nullptr;
+ // TODO: implement
+ return result;
+ };
+
+ virtual bool operator==(const self_type& right_hand_side)
+ {
+ bool result = false;
+ // TODO: implement
+ return result;
+ };
+
+ bool grow()
+ {
+ bool result = false;
+ AD* temp = new (std::nothrow) AD[this->capacity_ + this->growth_];
+ if (temp != nullptr)
+ {
+ for (size_t index = 0; index < this->size_; ++index)
+ temp[index] = this->data_[index];
+
+ delete[] this->data_;
+ this->data_ = temp;
+
+ this->capacity_ += this->growth_;
+ result = true;
+ }
+
+ return result;
+ };
+