diff options
Diffstat (limited to 'include/plist/Array.h')
-rw-r--r-- | include/plist/Array.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/include/plist/Array.h b/include/plist/Array.h index 0239c78..f4360c5 100644 --- a/include/plist/Array.h +++ b/include/plist/Array.h @@ -43,6 +43,10 @@ public : typedef std::vector<Node*>::const_iterator const_iterator; Node* operator[](unsigned int index); + Node* Back(); + Node* back(); + Node* Front(); + Node* front(); iterator Begin(); iterator begin(); iterator End(); @@ -52,11 +56,20 @@ public : const_iterator End() const; const_iterator end() const; size_t size() const; - void Append(Node* node); - void Insert(Node* node, unsigned int pos); + void Append(const Node& node); + void Append(const Node* node); + void Insert(const Node& node, unsigned int pos); + void Insert(const Node* node, unsigned int pos); void Remove(Node* node); void Remove(unsigned int pos); - unsigned int GetNodeIndex(Node* node) const; + unsigned int GetNodeIndex(const Node& node) const; + unsigned int GetNodeIndex(const Node* node) const; + template <typename T> T* at(unsigned int index) { + return (T*)(_array.at(index)); + } + template <typename T> T* At(unsigned int index) { + return (T*)(_array.at(index)); + } private : std::vector<Node*> _array; |