Vector.pkg 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. $#include "Vector.h"
  2. $#include "Vector3.h"
  3. class Vector : public VectorBase
  4. {
  5. TOLUA_TEMPLATE_BIND(T, String)
  6. Vector();
  7. Vector(const Vector<T>& vector);
  8. ~Vector();
  9. Vector<T> operator + (const T& rhs) const;
  10. Vector<T> operator + (const Vector<T>& rhs) const;
  11. bool operator == (const Vector<T>& rhs) const;
  12. T& operator [] (unsigned index);
  13. const T& operator [] (unsigned index) const;
  14. T& At(unsigned index);
  15. const T& At(unsigned index) const;
  16. void Push(const T& value);
  17. void Push(const Vector<T>& vector);
  18. void Pop();
  19. void Insert(unsigned pos, const T& value);
  20. void Insert(unsigned pos, const Vector<T>& vector);
  21. void Erase(unsigned pos, unsigned length = 1);
  22. bool Remove(const T& value);
  23. void Clear();
  24. void Resize(unsigned newSize);
  25. void Reserve(unsigned newCapacity);
  26. void Compact();
  27. bool Contains(const T& value) const;
  28. T& Front();
  29. const T& Front() const;
  30. T& Back();
  31. const T& Back() const;
  32. unsigned Size() const;
  33. unsigned Capacity() const;
  34. bool Empty() const;
  35. tolua_readonly tolua_property__no_prefix unsigned size;
  36. tolua_readonly tolua_property__no_prefix unsigned capacity;
  37. tolua_readonly tolua_property__no_prefix bool empty;
  38. };
  39. class PODVector
  40. {
  41. TOLUA_TEMPLATE_BIND(T, Vector3)
  42. PODVector();
  43. PODVector(const PODVector<T>& vector);
  44. ~PODVector();
  45. PODVector<T> operator + (const T& rhs) const;
  46. PODVector<T> operator + (const PODVector<T>& rhs) const;
  47. bool operator == (const PODVector<T>& rhs) const;
  48. T& operator [] (unsigned index);
  49. const T& operator [] (unsigned index) const;
  50. T& At(unsigned index);
  51. const T& At(unsigned index) const;
  52. void Push(const T& value);
  53. void Push(const PODVector<T>& vector);
  54. void Pop();
  55. void Insert(unsigned pos, const T& value);
  56. void Insert(unsigned pos, const PODVector<T>& vector);
  57. void Erase(unsigned pos, unsigned length = 1);
  58. bool Remove(const T& value);
  59. void Clear();
  60. void Resize(unsigned newSize);
  61. void Reserve(unsigned newCapacity);
  62. void Compact();
  63. bool Contains(const T& value) const;
  64. T& Front();
  65. const T& Front() const;
  66. T& Back();
  67. const T& Back() const;
  68. unsigned Size() const;
  69. unsigned Capacity() const;
  70. bool Empty() const;
  71. tolua_readonly tolua_property__no_prefix unsigned size;
  72. tolua_readonly tolua_property__no_prefix unsigned capacity;
  73. tolua_readonly tolua_property__no_prefix bool empty;
  74. };