2 #ifndef _GEMFIRE_VECTORT_HPP_ 3 #define _GEMFIRE_VECTORT_HPP_ 13 #include "gfcpp_globals.hpp" 48 inline const PTR_TYPE operator * ( )
const 50 return staticCast<PTR_TYPE>( *m_iter );
59 inline void operator ++ (
int )
64 inline bool operator == (
const Iterator& other )
const 66 return ( m_iter == other.m_iter );
69 inline bool operator != (
const Iterator& other )
const 71 return ( m_iter != other.m_iter );
79 inline int32_t
size( )
const 81 return static_cast<int32_t
> (m_vector.
size());
87 return static_cast<int32_t
> (m_vector.
size());
93 return static_cast<int32_t
> (m_vector.
max_size());
99 return static_cast<int32_t
> (m_vector.
capacity());
105 return m_vector.
empty();
111 return staticCast<PTR_TYPE>( m_vector[n] );
117 return staticCast<PTR_TYPE>( m_vector[n] );
121 inline PTR_TYPE
at( int32_t n )
123 return staticCast<PTR_TYPE>( m_vector.
at( n ) );
127 inline const PTR_TYPE
at( int32_t n )
const 129 return staticCast<PTR_TYPE>( m_vector.
at( n ) );
135 return Iterator( m_vector.
begin( ) );
139 inline Iterator
end( )
const 141 return Iterator( m_vector.
end( ) );
157 inline VectorT( int32_t n,
const PTR_TYPE& t )
164 : m_vector( other.m_vector )
177 m_vector = other.m_vector;
190 return staticCast<PTR_TYPE>( m_vector.
front( ) );
194 inline const PTR_TYPE
front( )
const 196 return staticCast<PTR_TYPE>( m_vector.
front( ) );
202 return staticCast<PTR_TYPE>( m_vector.
back( ) );
206 inline const PTR_TYPE
back( )
const 208 return staticCast<PTR_TYPE>( m_vector.
back( ) );
226 m_vector.
swap( other.m_vector );
238 inline void resize(int32_t n,
const PTR_TYPE& t = NULLPTR)
244 inline void insert( int32_t index,
const PTR_TYPE& t )
246 m_vector.
insert( index, t );
252 m_vector.
erase( index );
278 _VectorOfCacheable() { }
282 _VectorOfCacheable(n) { }
286 _VectorOfCacheable(n, t) { }
290 _VectorOfCacheable(other) { }
301 public _VectorOfCacheableKey,
public SharedBase 309 _VectorOfCacheableKey() { }
313 _VectorOfCacheableKey(n) { }
317 _VectorOfCacheableKey(n, t) { }
321 _VectorOfCacheableKey(other) { }
Iterator begin() const
Get an iterator pointing to the start of vector.
Definition: VectorT.hpp:133
void pop_back()
removes the last element.
Definition: VectorT.hpp:218
bool empty() const
return true if the vector's size is 0.
Definition: VectorT.hpp:103
Vector template type class.
Definition: VectorT.hpp:24
void swap(VectorOfSharedBase &other)
swaps the contents of two vectors.
Represents a vector of gemfire::SharedBasePtr
Definition: VectorOfSharedBase.hpp:35
int32_t max_size() const
return the largest possible size of the vector.
Definition: VectorT.hpp:91
void pop_back()
removes the last element.
VectorT & operator=(const VectorT &other)
assignment operator
Definition: VectorT.hpp:175
int32_t capacity() const
return the number of elements allocated for this vector.
Definition: VectorT.hpp:97
SharedBasePtr & front()
returns the first element.
A vector of CacheableKey objects that also extends SharedBase for smart pointers. ...
Definition: VectorT.hpp:300
PTR_TYPE front()
returns the first element.
Definition: VectorT.hpp:188
VectorOfCacheable(const VectorOfCacheable &other)
Copy constructor.
Definition: VectorT.hpp:289
VectorOfCacheableKey(int32_t n, const CacheableKeyPtr &t)
Create a vector with n copies of t.
Definition: VectorT.hpp:316
PTR_TYPE back()
returns the last element.
Definition: VectorT.hpp:200
VectorOfCacheable(int32_t n)
Create a vector with n elements allocated.
Definition: VectorT.hpp:281
VectorOfCacheable()
Create an empty vector.
Definition: VectorT.hpp:277
void clear()
erases all elements.
VectorT(int32_t n, const PTR_TYPE &t)
Create a vector with n copies of t.
Definition: VectorT.hpp:157
int32_t capacity() const
return the number of elements allocated for this vector.
void erase(int32_t index)
Removes the object at the specified index from a vector.
Definition: VectorT.hpp:250
VectorOfCacheable(int32_t n, const CacheablePtr &t)
Create a vector with n copies of t.
Definition: VectorT.hpp:285
A vector of Cacheable objects that also extends SharedBase for smart pointers.
Definition: VectorT.hpp:269
_VectorOfCacheable::Iterator Iterator
Iterator class for the vector.
Definition: VectorT.hpp:274
void insert(int32_t index, const SharedBasePtr &t)
insert object at the given index.
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
VectorT()
Create an empty vector.
Definition: VectorT.hpp:145
void reserve(int32_t n)
reallocate a vector to hold n elements.
Definition: VectorT.hpp:182
~VectorT()
destructor, sets all SharedPtr elements to NULLPTR
Definition: VectorT.hpp:169
int32_t length() const
synonym for size.
Definition: VectorT.hpp:85
VectorOfCacheableKey()
Create an empty vector.
Definition: VectorT.hpp:308
const PTR_TYPE back() const
returns the last element.
Definition: VectorT.hpp:206
Interface of an iterator for VectorOfSharedBase.
Definition: VectorOfSharedBase.hpp:43
const PTR_TYPE front() const
returns the first element.
Definition: VectorT.hpp:194
const PTR_TYPE at(int32_t n) const
Return the n'th element with bounds checking.
Definition: VectorT.hpp:127
bool empty() const
return true if the vector's size is 0.
void push_back(const SharedBasePtr &e)
insert a new element at the end.
void swap(VectorT &other)
swaps the contents of two vectors.
Definition: VectorT.hpp:224
void resize(int32_t n, const PTR_TYPE &t=gemfire::NullSharedBase::s_instancePtr)
inserts or erases elements at the end such that size becomes n.
Definition: VectorT.hpp:238
void erase(int32_t index)
removes the object at the specified index from a vector
Iterator begin() const
Get an iterator pointing to the start of vector.
VectorOfCacheableKey(const VectorOfCacheableKey &other)
Copy constructor.
Definition: VectorT.hpp:320
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51
This abstract base class is the base class of all user objects that have the shared capability of ref...
Definition: SharedBase.hpp:31
VectorT(const VectorT &other)
copy constructor
Definition: VectorT.hpp:163
Interface of an iterator for VectorT.
Definition: VectorT.hpp:32
PTR_TYPE operator[](int32_t n)
Return the n'th element.
Definition: VectorT.hpp:109
Iterator end() const
Get an iterator pointing to the end of vector.
Definition: VectorT.hpp:139
PTR_TYPE at(int32_t n)
Return the n'th element with bounds checking.
Definition: VectorT.hpp:121
int32_t max_size() const
return the largest possible size of the vector.
int32_t size() const
return the size of the vector.
void resize(int32_t n, const SharedBasePtr &t=gemfire::NullSharedBase::s_instancePtr)
inserts or erases elements at the end such that size becomes n.
void reserve(int32_t n)
reallocate a vector to hold n elements.
int32_t size() const
return the size of the vector.
Definition: VectorT.hpp:79
SharedBasePtr & back()
returns the last element.
Iterator end() const
Get an iterator pointing to the end of vector.
void push_back(const PTR_TYPE &e)
insert a new element at the end.
Definition: VectorT.hpp:212
_VectorOfCacheableKey::Iterator Iterator
Iterator class for the vector.
Definition: VectorT.hpp:305
SharedBasePtr & at(int32_t n)
Return the n'th element with bounds checking.
void clear()
erases all elements.
Definition: VectorT.hpp:230
VectorOfCacheableKey(int32_t n)
Create a vector with n elements allocated.
Definition: VectorT.hpp:312
void insert(int32_t index, const PTR_TYPE &t)
insert object at the given position.
Definition: VectorT.hpp:244
Defines a reference counted shared pointer.
Definition: SharedPtr.hpp:35
VectorT(int32_t n)
Create a vector with n elements allocated.
Definition: VectorT.hpp:151