build-artifacts/win/product/include/gfcpp/VectorOfSharedBase.hpp

Go to the documentation of this file.
00001 
00002 #ifndef _GEMFIRE_VECTOROFSHAREDBASE_HPP_
00003 #define _GEMFIRE_VECTOROFSHAREDBASE_HPP_
00004 
00005 /*=========================================================================
00006  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
00007  * This product is protected by U.S. and international copyright
00008  * and intellectual property laws. Pivotal products are covered by
00009  * more patents listed at http://www.pivotal.io/patents.
00010  *========================================================================
00011  */
00012 
00013 #include "gfcpp_globals.hpp"
00014 
00015 #include "SharedPtr.hpp"
00016 #ifdef BUILD_CPPCACHE
00017 #include <vector>
00018 #endif
00019 
00023 namespace gemfire {
00024 
00025 #ifdef BUILD_CPPCACHE
00026 typedef std::vector< gemfire::SharedBasePtr > VofSBP;
00027 typedef VofSBP::const_iterator VofSBPIterator;
00028 #else
00029 class VofSBP;
00030 class VofSBPIterator;
00031 #endif
00032 
00035 class CPPCACHE_EXPORT VectorOfSharedBase
00036 {
00037   private:
00038     VofSBP* m_stdvector;
00039 
00040   public:
00041 
00043     class CPPCACHE_EXPORT Iterator 
00044     {
00045       private:
00046 
00047         VofSBPIterator* m_iter;
00048 
00049         Iterator( const VofSBPIterator& iter );
00050         // Never defined.
00051         Iterator( );
00052 
00053         private:
00054           const Iterator& operator=( const Iterator& ); 
00055 
00056       public:
00057 
00058         Iterator( const Iterator& other );
00059 
00060         const SharedBasePtr operator * ( ) const;
00061 
00062         Iterator& operator ++ ( );
00063 
00064         void operator ++ ( int );
00065 
00066         bool operator == ( const Iterator& other ) const;
00067 
00068         bool operator != ( const Iterator& other ) const;
00069 
00070         ~Iterator( );
00071 
00072 
00073         friend class VectorOfSharedBase;
00074     };
00075 
00077     int32_t size( ) const;
00078 
00080     int32_t max_size( ) const;
00081 
00083     int32_t capacity( ) const;
00084 
00086     bool empty( ) const;
00087 
00089     SharedBasePtr& operator [] ( int32_t n );
00090 
00092     const SharedBasePtr& operator [] ( int32_t n ) const;
00093 
00095     SharedBasePtr& at( int32_t n );
00096 
00098     SharedBasePtr& at( int32_t n ) const;
00099 
00101     Iterator begin( ) const;
00102 
00104     Iterator end( ) const;
00105 
00107     VectorOfSharedBase( );
00108 
00110     VectorOfSharedBase( int32_t n );
00111 
00113     VectorOfSharedBase( int32_t n, const SharedBasePtr& t );
00114 
00116     VectorOfSharedBase( const VectorOfSharedBase& other );
00117 
00119     ~VectorOfSharedBase( );
00120 
00122     VectorOfSharedBase& operator = ( const VectorOfSharedBase& other );
00123 
00125     void reserve( int32_t n );
00126 
00128     SharedBasePtr& front( );
00129 
00131     const SharedBasePtr& front( ) const;
00132 
00134     SharedBasePtr& back( );
00135 
00137     const SharedBasePtr& back( ) const;
00138 
00140     void push_back( const SharedBasePtr& e );
00141 
00143     void pop_back( );
00144 
00146     void swap( VectorOfSharedBase& other );
00147 
00149     void clear( );
00150 
00154     void resize(int32_t n, const SharedBasePtr& t = NULLPTR);
00155 
00157     void insert( int32_t index, const SharedBasePtr& t );
00158 
00161     void erase( int32_t index );
00162 
00163 };
00164 
00165 }
00166 
00167 #endif
00168 

GemFire C++ Cache API Documentation