VMware GemFire Native Client Cache Reference  9.0.6
VectorOfSharedBase.hpp
Go to the documentation of this file.
1 
2 #ifndef _GEMFIRE_VECTOROFSHAREDBASE_HPP_
3 #define _GEMFIRE_VECTOROFSHAREDBASE_HPP_
4 
5 /*=========================================================================
6  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
7  * This product is protected by U.S. and international copyright
8  * and intellectual property laws. Pivotal products are covered by
9  * more patents listed at http://www.pivotal.io/patents.
10  *========================================================================
11  */
12 
13 #include "gfcpp_globals.hpp"
14 
15 #include "SharedPtr.hpp"
16 #ifdef BUILD_CPPCACHE
17 #include <vector>
18 #endif
19 
23 namespace gemfire {
24 
25 #ifdef BUILD_CPPCACHE
26 typedef std::vector< gemfire::SharedBasePtr > VofSBP;
27 typedef VofSBP::const_iterator VofSBPIterator;
28 #else
29 class VofSBP;
30 class VofSBPIterator;
31 #endif
32 
36 {
37  private:
38  VofSBP* m_stdvector;
39 
40  public:
41 
44  {
45  private:
46 
47  VofSBPIterator* m_iter;
48 
49  Iterator( const VofSBPIterator& iter );
50  // Never defined.
51  Iterator( );
52 
53  private:
54  const Iterator& operator=( const Iterator& );
55 
56  public:
57 
58  Iterator( const Iterator& other );
59 
60  const SharedBasePtr operator * ( ) const;
61 
62  Iterator& operator ++ ( );
63 
64  void operator ++ ( int );
65 
66  bool operator == ( const Iterator& other ) const;
67 
68  bool operator != ( const Iterator& other ) const;
69 
70  ~Iterator( );
71 
72 
73  friend class VectorOfSharedBase;
74  };
75 
77  int32_t size( ) const;
78 
80  int32_t max_size( ) const;
81 
83  int32_t capacity( ) const;
84 
86  bool empty( ) const;
87 
89  SharedBasePtr& operator [] ( int32_t n );
90 
92  const SharedBasePtr& operator [] ( int32_t n ) const;
93 
95  SharedBasePtr& at( int32_t n );
96 
98  SharedBasePtr& at( int32_t n ) const;
99 
101  Iterator begin( ) const;
102 
104  Iterator end( ) const;
105 
108 
110  VectorOfSharedBase( int32_t n );
111 
113  VectorOfSharedBase( int32_t n, const SharedBasePtr& t );
114 
116  VectorOfSharedBase( const VectorOfSharedBase& other );
117 
119  ~VectorOfSharedBase( );
120 
122  VectorOfSharedBase& operator = ( const VectorOfSharedBase& other );
123 
125  void reserve( int32_t n );
126 
128  SharedBasePtr& front( );
129 
131  const SharedBasePtr& front( ) const;
132 
134  SharedBasePtr& back( );
135 
137  const SharedBasePtr& back( ) const;
138 
140  void push_back( const SharedBasePtr& e );
141 
143  void pop_back( );
144 
146  void swap( VectorOfSharedBase& other );
147 
149  void clear( );
150 
154  void resize(int32_t n, const SharedBasePtr& t = NULLPTR);
155 
157  void insert( int32_t index, const SharedBasePtr& t );
158 
161  void erase( int32_t index );
162 
163 };
164 
165 }
166 
167 #endif
168 
Represents a vector of gemfire::SharedBasePtr
Definition: VectorOfSharedBase.hpp:35
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
Interface of an iterator for VectorOfSharedBase.
Definition: VectorOfSharedBase.hpp:43
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51
Defines a reference counted shared pointer.
Definition: SharedPtr.hpp:35

GemFire C++ Cache API Documentation