Added some more functions to list API. Fixed return type of size() call and made...
[libftdi] / ftdipp / ftdi.hpp
index 4c3b7c5..d752bd6 100644 (file)
@@ -162,11 +162,9 @@ private:
     boost::shared_ptr<Private> d;
 };
 
-typedef std::list<Context> ListBase;
-
 /*! \brief Device list.
  */
-class List : public ListBase
+class List
 {
 public:
     List(struct ftdi_device_list* devlist = 0);
@@ -174,6 +172,37 @@ public:
 
     static List* find_all(int vendor, int product);
 
+    /// List type storing "Context" objects
+    typedef std::list<Context> ListType;
+    /// Iterator type for the container
+    typedef ListType::iterator iterator;
+    /// Const iterator type for the container
+    typedef ListType::const_iterator const_iterator;
+    /// Reverse iterator type for the container
+    typedef ListType::reverse_iterator reverse_iterator;
+    /// Const reverse iterator type for the container
+    typedef ListType::const_reverse_iterator const_reverse_iterator;
+
+    iterator begin();
+    iterator end();
+    const_iterator begin() const;
+    const_iterator end() const;
+
+    reverse_iterator rbegin();
+    reverse_iterator rend();
+    const_reverse_iterator rbegin() const;
+    const_reverse_iterator rend() const;
+
+    ListType::size_type size() const;
+    bool empty() const;
+    void clear();
+
+    void push_back(const Context& element);
+    void push_front(const Context& element);
+
+    iterator erase(iterator pos);
+    iterator erase(iterator beg, iterator end);
+
 private:
     class Private;
     boost::shared_ptr<Private> d;