VMware GemFire Native C++ Reference  9.1
VectorOfSharedBase.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_VECTOROFSHAREDBASE_H_
4 #define GEODE_VECTOROFSHAREDBASE_H_
5 
6 /*
7  * Licensed to the Apache Software Foundation (ASF) under one or more
8  * contributor license agreements. See the NOTICE file distributed with
9  * this work for additional information regarding copyright ownership.
10  * The ASF licenses this file to You under the Apache License, Version 2.0
11  * (the "License"); you may not use this file except in compliance with
12  * the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 
23 #include "geode_globals.hpp"
24 
25 #include "SharedPtr.hpp"
26 #ifdef BUILD_CPPCACHE
27 #include <vector>
28 #endif
29 
33 namespace apache {
34 namespace geode {
35 namespace client {
36 
37 #ifdef BUILD_CPPCACHE
38 typedef std::vector<apache::geode::client::SharedBasePtr> VofSBP;
39 typedef VofSBP::const_iterator VofSBPIterator;
40 #else
41 class VofSBP;
42 class VofSBPIterator;
43 #endif
44 
48  private:
49  VofSBP* m_stdvector;
50 
51  public:
54  private:
55  VofSBPIterator* m_iter;
56 
57  Iterator(const VofSBPIterator& iter);
58  // Never defined.
59  Iterator();
60 
61  private:
62  const Iterator& operator=(const Iterator&);
63 
64  public:
65  Iterator(const Iterator& other);
66 
67  const SharedBasePtr operator*() const;
68 
69  Iterator& operator++();
70 
71  void operator++(int);
72 
73  bool operator==(const Iterator& other) const;
74 
75  bool operator!=(const Iterator& other) const;
76 
77  ~Iterator();
78 
79  friend class VectorOfSharedBase;
80  };
81 
83  int32_t size() const;
84 
86  int32_t max_size() const;
87 
89  int32_t capacity() const;
90 
92  bool empty() const;
93 
95  SharedBasePtr& operator[](int32_t n);
96 
98  const SharedBasePtr& operator[](int32_t n) const;
99 
101  SharedBasePtr& at(int32_t n);
102 
104  SharedBasePtr& at(int32_t n) const;
105 
107  Iterator begin() const;
108 
110  Iterator end() const;
111 
114 
116  VectorOfSharedBase(int32_t n);
117 
119  VectorOfSharedBase(int32_t n, const SharedBasePtr& t);
120 
123 
126 
128  VectorOfSharedBase& operator=(const VectorOfSharedBase& other);
129 
131  void reserve(int32_t n);
132 
134  SharedBasePtr& front();
135 
137  const SharedBasePtr& front() const;
138 
140  SharedBasePtr& back();
141 
143  const SharedBasePtr& back() const;
144 
146  void push_back(const SharedBasePtr& e);
147 
149  void pop_back();
150 
152  void swap(VectorOfSharedBase& other);
153 
155  void clear();
156 
160  void resize(int32_t n, const SharedBasePtr& t = NULLPTR);
161 
163  void insert(int32_t index, const SharedBasePtr& t);
164 
167  void erase(int32_t index);
168 };
169 } // namespace client
170 } // namespace geode
171 } // namespace apache
172 
173 #endif // GEODE_VECTOROFSHAREDBASE_H_
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
Defines a reference counted shared pointer.
Definition: SharedPtr.hpp:52
Interface of an iterator for VectorOfSharedBase.
Definition: VectorOfSharedBase.hpp:53
Represents a vector of apache::geode::client::SharedBasePtr
Definition: VectorOfSharedBase.hpp:47
This namespace contains all the Geode C++ API classes, enumerations and globals.

Pivotal GemFire C++ Cache API Documentation