Browse Source

build on windows

David Rose 17 years ago
parent
commit
5d1cb7e88f
2 changed files with 28 additions and 1 deletions
  1. 24 0
      panda/src/express/pointerToArray.I
  2. 4 1
      panda/src/express/pointerToArray.h

+ 24 - 0
panda/src/express/pointerToArray.I

@@ -458,6 +458,18 @@ set_element(size_type n, const Element &value) {
   (*this)[n] = value;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: PointerToArray::__getitem__
+//       Access: Published
+//  Description: Same as get_element(), this returns the nth element
+//               of the array.
+////////////////////////////////////////////////////////////////////
+template<class Element>
+INLINE const Element &PointerToArray<Element>::
+__getitem__(size_type n) const {
+  return (*this)[n];
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: PointerToArray::__setitem__
 //       Access: Published
@@ -938,6 +950,18 @@ get_element(size_type n) const {
   return (*this)[n];
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: ConstPointerToArray::__getitem__
+//       Access: Published
+//  Description: Same as get_element(), this returns the nth element
+//               of the array.
+////////////////////////////////////////////////////////////////////
+template<class Element>
+INLINE const Element &ConstPointerToArray<Element>::
+__getitem__(size_type n) const {
+  return (*this)[n];
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: ConstPointerToArray::get_data
 //       Access: Published

+ 4 - 1
panda/src/express/pointerToArray.h

@@ -113,7 +113,7 @@ PUBLISHED:
   INLINE void pop_back();
   INLINE const Element &get_element(size_type n) const;
   INLINE void set_element(size_type n, const Element &value);
-  INLINE const Element &operator [](size_type n) const;
+  INLINE const Element &__getitem__(size_type n) const;
   INLINE void __setitem__(size_type n, const Element &value);
   INLINE string get_data() const;
   INLINE void set_data(const string &data);
@@ -193,6 +193,7 @@ public:
   // Methods to help out Python and other high-level languages.
   INLINE const Element &get_element(size_type n) const;
   INLINE void set_element(size_type n, const Element &value);
+  INLINE const Element &__getitem__(size_type n) const;
   INLINE void __setitem__(size_type n, const Element &value);
   INLINE string get_data() const;
   INLINE void set_data(const string &data);
@@ -255,6 +256,7 @@ PUBLISHED:
   typedef TYPENAME pvector<Element>::size_type size_type;
   INLINE size_type size() const;
   INLINE const Element &get_element(size_type n) const;
+  INLINE const Element &__getitem__(size_type n) const;
   INLINE string get_data() const;
   INLINE string get_subdata(size_type n, size_type count) const;
   INLINE int get_ref_count() const;
@@ -312,6 +314,7 @@ PUBLISHED:
 
   // Methods to help out Python and other high-level languages.
   INLINE const Element &get_element(size_type n) const;
+  INLINE const Element &__getitem__(size_type n) const;
   INLINE string get_data() const;
   INLINE string get_subdata(size_type n, size_type count) const;