YAPOG  0.0.1
Yet Another Pokemon Online Game
List.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_LIST_HPP
2 # define YAPOG_LIST_HPP
3 
4 # include <list>
5 
6 # include "YAPOG/Macros.hpp"
8 
9 namespace yap
10 {
11  namespace collection
12  {
13  template <typename T>
14  class List
15  {
16  public:
17 
18  typedef T DataType;
19  typedef std::list<DataType> InnerType;
20  typedef typename InnerType::size_type SizeType;
21  typedef typename InnerType::iterator ItType;
22  typedef typename InnerType::const_iterator ConstItType;
23 
24  List ();
25 
26  List (const List<T>& copy);
27  List& operator= (const List<T>& copy);
28 
29  ItType begin ();
30  ConstItType begin () const;
31  ItType Begin ();
32  ConstItType Begin () const;
33 
34  ItType end ();
35  ConstItType end () const;
36  ItType End ();
37  ConstItType End () const;
38 
39  void Add (const T& data);
40  void Add (const List<T>& data);
41  void AddFront (const T& data);
42  void AddFront (const List<T>& data);
43 
44  bool Contains (const T& data) const;
45  bool Contains (const List<T>& data) const;
46 
47  void Remove (const T& data);
48  void RemoveFront ();
49  void RemoveBack ();
50 
51  void Clear ();
52 
53  bool IsEmpty () const;
54  SizeType Count () const;
55 
56  template <typename C>
57  void Sort ();
58 
59  private:
60 
62  };
63  } // namespace collection
64 } // namespace yap
65 
66 # include "YAPOG/Collection/List.hxx"
67 
68 #endif // YAPOG_LIST_HPP