All Classes Functions Variables Typedefs Friends Pages
IVector.h
1 //------------------------------------------------------------------------------
2 //
3 // Copyright (c) 2012 Glympse Inc. All rights reserved.
4 //
5 //------------------------------------------------------------------------------
6 
7 #ifndef IVECTOR_H__GLYMPSE__
8 #define IVECTOR_H__GLYMPSE__
9 
10 namespace Glympse
11 {
12 
13 template< class T > struct IVector : public IArray< T >
14 {
15  public: virtual void ensureCapacity(int32 capacity) = 0;
16 
17  public: virtual void addElement(const T& o) = 0;
18 
19  public: virtual void setElementAt(const T& o, int32 location) = 0;
20 
21  public: virtual void insertElementAt(const T& o, int32 location) = 0;
22 
23  public: virtual bool removeElementAt(int32 index) = 0;
24 
25  public: virtual void removeRange(int32 start, int32 end) = 0;
26 
27  public: virtual bool removeElement(const T& o) = 0;
28 
29  public: virtual void removeAllElements() = 0;
30 
31  public: virtual bool contains(const T& o) = 0;
32 
33  public: virtual int32 size() = 0;
34 
35  public: virtual bool isEmpty() = 0;
36 
37  public: virtual T elementAt(int32 index) = 0;
38 
39  public: virtual T lastElement() = 0;
40 
41  public: virtual void sort(const typename GComparator<T>::ptr& comparator) = 0;
42 };
43 
44 template< class T > class GVector
45 {
46  private: GVector();
47  public: typedef O< IVector< T > > ptr;
48 };
49 
50 }
51 
52 #endif // !IVECTOR_H__GLYMPSE__