Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00031 #ifndef GENICAM_GENAPI_NODEVECTOR_H
00032 #define GENICAM_GENAPI_NODEVECTOR_H
00033
00034
00035 #include <GenApi/GenApiDll.h>
00036 #include <GenICamFwd.h>
00037
00038 #include <vector>
00039
00040 #ifndef _WIN32
00041 # include <stdint.h>
00042 #endif
00043
00044 #if defined ( __GNUC__ ) && !defined (VXWORKS) && !defined ( __APPLE__ )
00045 using namespace __gnu_cxx;
00046 #endif
00047
00048 #if defined ( __GNUC__ ) && defined ( __linux__)
00049 # include <cstddef>
00050 #endif
00051
00052 #if defined (_WIN32) || (defined (__GNUC__) && (defined (__linux__) || defined (__APPLE__) || defined(VXWORKS)))
00053
00054
00055
00056 #ifdef _MSC_VER
00057 # pragma warning( disable : 4312 )
00058 #endif
00059
00060 namespace GENAPI_NAMESPACE
00061 {
00062 struct INode;
00063 struct IValue;
00064
00065
00066
00067
00068
00069
00074 class GENAPI_DECL node_vector
00075 {
00076 typedef INode* T;
00077
00078
00079
00080 public:
00081 class GENAPI_DECL const_iterator
00082 {
00083
00084
00085 public:
00086 typedef std::random_access_iterator_tag iterator_category;
00087 typedef T value_type;
00088 typedef ptrdiff_t difference_type;
00089 typedef T* pointer;
00090 typedef T& reference;
00091
00092
00093 public:
00094 const_iterator ( T *pPtr = 0 );
00095
00096
00097
00098 public:
00099 const T & operator * ( void ) const;
00100 const_iterator & operator ++ ( void );
00101 const_iterator operator ++ ( int );
00102 const_iterator & operator -- ( void );
00103 const_iterator operator -- ( int );
00104 const_iterator & operator += ( intptr_t iInc );
00105 const_iterator operator += ( intptr_t iInc ) const;
00106 const_iterator operator + ( intptr_t iInc ) const;
00107 const_iterator & operator -= ( intptr_t iDec );
00108 const_iterator operator -= ( intptr_t iDec ) const;
00109 intptr_t operator - ( const const_iterator &iter ) const;
00110 const_iterator operator - ( intptr_t iDec ) const;
00111 const T & operator [] ( intptr_t iIndex ) const;
00112 bool operator == ( const const_iterator &iter ) const;
00113 bool operator != ( const const_iterator &iter ) const;
00114 bool operator < ( const const_iterator &iter ) const;
00115 bool operator > ( const const_iterator &iter ) const;
00116 bool operator <= ( const const_iterator &iter ) const;
00117 bool operator >= ( const const_iterator &iter ) const;
00118 GENAPI_DECL
00119 friend const_iterator operator + ( intptr_t iInc, const const_iterator &iter);
00120
00121
00122
00123 protected:
00124 T * _ps;
00125 };
00126
00127 class GENAPI_DECL iterator :
00128 public const_iterator
00129 {
00130 public:
00131
00132
00133 typedef std::random_access_iterator_tag iterator_category;
00134 typedef T value_type;
00135 typedef const_iterator::difference_type difference_type;
00136 typedef const_iterator::pointer pointer;
00137 typedef const_iterator::reference reference;
00138
00139
00140 public:
00141 iterator ( T *pPtr = 0 );
00142
00143
00144
00145 public:
00146 T & operator * ( void ) const;
00147 iterator & operator ++ ( void );
00148 iterator operator ++ ( int );
00149 iterator & operator -- ( void );
00150 iterator operator -- ( int );
00151 iterator & operator += ( intptr_t iInc );
00152 iterator operator += ( intptr_t iInc ) const;
00153 iterator operator + ( intptr_t iInc ) const;
00154 iterator & operator -= ( intptr_t iDec );
00155 iterator operator -= ( intptr_t iDec ) const;
00156 intptr_t operator - ( const iterator &iter ) const;
00157 iterator operator - ( intptr_t iDec ) const;
00158 T & operator [] ( intptr_t iIndex ) const;
00159 GENAPI_DECL
00160 friend iterator operator + ( intptr_t iInc, const iterator &iter);
00161 };
00162
00163
00164
00165 public:
00166 node_vector ( void );
00167 explicit node_vector ( size_t uiSize);
00168 node_vector ( const node_vector &obj);
00169 virtual ~node_vector ( void );
00170
00171
00172
00173 public:
00174 virtual void assign ( size_t n, const T &val );
00175 virtual void clear ( void );
00176 virtual iterator erase ( iterator pos );
00177 virtual T & at ( size_t uiIndex );
00178 virtual const T & at ( size_t uiIndex ) const;
00179 virtual T & back ( void );
00180 virtual const T & back ( void ) const;
00181 virtual iterator begin ( void );
00182 virtual const_iterator begin ( void ) const;
00183 virtual size_t capacity ( void ) const;
00184 virtual iterator end ( void );
00185 virtual const_iterator end ( void ) const;
00186 virtual T & front ( void );
00187 virtual const T & front ( void ) const;
00188 virtual size_t max_size ( void ) const;
00189 virtual size_t size ( void ) const;
00190 virtual iterator insert ( iterator pos, const T& val) ;
00191 virtual bool empty ( void ) const;
00192 virtual void pop_back ( void );
00193 virtual void push_back ( const T &val );
00194 virtual void resize ( size_t uiSize );
00195 virtual void reserve ( size_t uiSize );
00196
00197
00198 virtual void erase (size_t uiIndex);
00199 virtual void insert (size_t uiIndex, const T &val);
00200
00201
00202
00203 public:
00204 node_vector & operator = ( const node_vector &obj );
00205 T & operator [] ( size_t uiIndex );
00206 const T & operator [] ( size_t uiIndex ) const;
00207 void operator delete ( void *pWhere );
00208 void * operator new ( size_t uiSize );
00209
00210
00211
00212 private:
00213 typedef std::vector<T, std::allocator<T> > vector_t;
00214 vector_t *_pv;
00215 };
00216
00217
00218
00219
00220
00221
00222
00227 class GENAPI_DECL value_vector
00228 {
00229 typedef IValue* T;
00230
00231
00232 public:
00233 class GENAPI_DECL const_iterator
00234 {
00235
00236
00237 public:
00238 typedef std::random_access_iterator_tag iterator_category;
00239 typedef T value_type;
00240 typedef ptrdiff_t difference_type;
00241 typedef T* pointer;
00242 typedef T& reference;
00243
00244
00245
00246 public:
00247 const_iterator ( T *pPtr = 0 );
00248
00249
00250
00251 public:
00252 const T & operator * ( void ) const;
00253 const_iterator & operator ++ ( void );
00254 const_iterator operator ++ ( int );
00255 const_iterator & operator -- ( void );
00256 const_iterator operator -- ( int );
00257 const_iterator & operator += ( intptr_t iInc );
00258 const_iterator operator += ( intptr_t iInc ) const;
00259 const_iterator operator + ( intptr_t iInc ) const;
00260 const_iterator & operator -= ( intptr_t iDec );
00261 const_iterator operator -= ( intptr_t iDec ) const;
00262 intptr_t operator - ( const const_iterator &iter ) const;
00263 const_iterator operator - ( intptr_t iDec ) const;
00264 const T & operator [] ( intptr_t iIndex ) const;
00265 bool operator == ( const const_iterator &iter ) const;
00266 bool operator != ( const const_iterator &iter ) const;
00267 bool operator < ( const const_iterator &iter ) const;
00268 bool operator > ( const const_iterator &iter ) const;
00269 bool operator <= ( const const_iterator &iter ) const;
00270 bool operator >= ( const const_iterator &iter ) const;
00271 GENAPI_DECL
00272 friend const_iterator operator + ( intptr_t iInc, const const_iterator &iter);
00273
00274
00275
00276 protected:
00277 T * _ps;
00278 };
00279
00280 class GENAPI_DECL iterator :
00281 public const_iterator
00282 {
00283 public:
00284
00285
00286 typedef std::random_access_iterator_tag iterator_category;
00287 typedef T value_type;
00288 typedef const_iterator::difference_type difference_type;
00289 typedef const_iterator::pointer pointer;
00290 typedef const_iterator::reference reference;
00291
00292
00293 public:
00294 iterator ( T *pPtr = 0 );
00295
00296
00297
00298 public:
00299 T & operator * ( void ) const;
00300 iterator & operator ++ ( void );
00301 iterator operator ++ ( int );
00302 iterator & operator -- ( void );
00303 iterator operator -- ( int );
00304 iterator & operator += ( intptr_t iInc );
00305 iterator operator += ( intptr_t iInc ) const;
00306 iterator operator + ( intptr_t iInc ) const;
00307 iterator & operator -= ( intptr_t iDec );
00308 iterator operator -= ( intptr_t iDec ) const;
00309 intptr_t operator - ( const iterator &iter ) const;
00310 iterator operator - ( intptr_t iDec ) const;
00311 T & operator [] ( intptr_t iIndex ) const;
00312 GENAPI_DECL
00313 friend iterator operator + ( intptr_t iInc, const iterator &iter);
00314 };
00315
00316
00317
00318 public:
00319 value_vector ( void );
00320 explicit value_vector ( size_t uiSize);
00321 value_vector ( const value_vector &obj);
00322 virtual ~value_vector ( void );
00323
00324
00325
00326 public:
00327 virtual void assign ( size_t n, const T &obj );
00328 virtual void clear ( void );
00329 virtual iterator erase ( iterator pos );
00330 virtual T & at ( size_t uiIndex );
00331 virtual const T & at ( size_t uiIndex ) const;
00332 virtual T & back ( void );
00333 virtual const T & back ( void ) const;
00334 virtual iterator begin ( void );
00335 virtual const_iterator begin ( void ) const;
00336 virtual size_t capacity ( void ) const;
00337 virtual iterator end ( void );
00338 virtual const_iterator end ( void ) const;
00339 virtual T & front ( void );
00340 virtual const T & front ( void ) const;
00341 virtual size_t max_size ( void ) const;
00342 virtual size_t size ( void ) const;
00343 virtual iterator insert ( iterator pos, const T& val) ;
00344 virtual bool empty ( void ) const;
00345 virtual void pop_back ( void );
00346 virtual void push_back ( const T &val );
00347 virtual void resize ( size_t uiSize, const T &val );
00348 virtual void reserve ( size_t uiSize );
00349
00350
00351
00352 virtual void erase (size_t uiIndex);
00353 virtual void insert (size_t uiIndex, const T &val);
00354
00355
00356
00357 public:
00358 value_vector & operator = ( const value_vector &obj );
00359 T & operator [] ( size_t uiIndex );
00360 const T & operator [] ( size_t uiIndex ) const;
00361 void operator delete ( void *pWhere );
00362 void * operator new ( size_t uiSize );
00363
00364
00365
00366 private:
00367 typedef std::vector<T, std::allocator<T> > vector_t;
00368 vector_t *_pv;
00369 };
00370
00372 typedef value_vector FeatureList_t;
00373 }
00374
00375
00376 #else
00377 # error Unknown platform
00378 #endif
00379
00380 #endif // GENICAM_GENAPI_NODEVECTOR_H