Container.h
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //  (c) 2006 by Basler Vision Technologies
00003 //  Section:  Vision Components
00004 //  Project:  GenApi
00005 //    Author:  Alex Happe
00006 //  $Header$
00007 //
00008 //  License: This file is published under the license of the EMVA GenICam  Standard Group.
00009 //  A text file describing the legal terms is included in  your installation as 'GenICam_license.pdf'.
00010 //  If for some reason you are missing  this file please contact the EMVA or visit the website
00011 //  (http://www.genicam.org) for a full copy.
00012 //
00013 //  THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
00014 //  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00015 //  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00016 //  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD  GROUP
00017 //  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,
00018 //  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  LIMITED TO,
00019 //  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  DATA, OR PROFITS;
00020 //  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  THEORY OF LIABILITY,
00021 //  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE)
00022 //  ARISING IN ANY WAY OUT OF THE USE  OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00023 //  POSSIBILITY OF SUCH DAMAGE.
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 // conversion from 'uintptr_t' to 'void *' of greater size
00055 // This is a portability warning
00056 #pragma warning( disable : 4312 )
00057 
00058 namespace GENAPI_NAMESPACE
00059 {
00060     struct INode;
00061     struct IValue;
00062 
00063 
00064     //*************************************************************
00065     // N O D E _ V E C T O R
00066     //*************************************************************
00067 
00072     class GENAPI_DECL node_vector
00073     {
00074         typedef INode* T;
00075 
00076         // Nested types
00077         // ---------------------------------------------------------------------------
00078     public:
00079         class GENAPI_DECL const_iterator
00080         {
00081             // iterator traits
00082             // ------------------------------------------------------------------------
00083         public:
00084             typedef std::random_access_iterator_tag iterator_category;
00085             typedef T value_type;
00086             typedef ptrdiff_t difference_type;
00087             typedef T* pointer;
00088             typedef T& reference;
00089             // Ctor / Dtor
00090             // -------------------------------------------------------------------------
00091         public:
00092             const_iterator    ( T *pPtr = 0 );
00093 
00094             // Operators
00095             // -------------------------------------------------------------------------
00096         public:
00097             const T &               operator *        ( void )                  const;
00098             const_iterator &        operator ++       ( void );
00099             const_iterator          operator ++       ( int );
00100             const_iterator &        operator --       ( void );
00101             const_iterator          operator --       ( int );
00102             const_iterator &        operator +=       ( intptr_t iInc );
00103             const_iterator          operator +=       ( intptr_t iInc )         const;
00104             const_iterator          operator +        ( intptr_t iInc )         const;
00105             const_iterator &        operator -=       ( intptr_t iDec );
00106             const_iterator          operator -=       ( intptr_t iDec )         const;
00107             intptr_t                operator -        ( const const_iterator &iter ) const;
00108             const_iterator          operator -        ( intptr_t iDec )         const;
00109             const T &               operator []       ( intptr_t iIndex )       const;
00110             bool                    operator ==       ( const const_iterator &iter ) const;
00111             bool                    operator !=       ( const const_iterator &iter ) 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             GENAPI_DECL
00117             friend const_iterator   operator +        ( intptr_t iInc, const const_iterator &iter);
00118 
00119             // Member
00120             // -------------------------------------------------------------------------
00121         protected:
00122             T *              _ps;
00123         };
00124 
00125         class GENAPI_DECL iterator :
00126             public const_iterator
00127         {
00128         public:
00129             // iterator traits
00130             // -------------------------------------------------------------------------
00131             typedef std::random_access_iterator_tag iterator_category;
00132             typedef T value_type;
00133             typedef const_iterator::difference_type difference_type;
00134             typedef const_iterator::pointer pointer;
00135             typedef const_iterator::reference reference;
00136             // Ctor / Dtor
00137             // -------------------------------------------------------------------------
00138         public:
00139                                     iterator          ( T *pPtr = 0 );
00140 
00141             // Operators
00142             // -------------------------------------------------------------------------
00143         public:
00144             T &                     operator *        ( void )                  const;
00145             iterator &              operator ++       ( void );
00146             iterator                operator ++       ( int );
00147             iterator &              operator --       ( void );
00148             iterator                operator --       ( int );
00149             iterator &              operator +=       ( intptr_t iInc );
00150             iterator                operator +=       ( intptr_t iInc )         const;
00151             iterator                operator +        ( intptr_t iInc )         const;
00152             iterator &              operator -=       ( intptr_t iDec );
00153             iterator                operator -=       ( intptr_t iDec )         const;
00154             intptr_t                operator -        ( const iterator &iter )  const;
00155             iterator                operator -        ( intptr_t iDec )         const;
00156             T &                     operator []       ( intptr_t iIndex )       const;
00157             GENAPI_DECL
00158             friend iterator     operator +        ( intptr_t iInc, const iterator &iter);
00159         };
00160 
00161         // Ctor / Dtor
00162         // ---------------------------------------------------------------------------
00163     public:
00164                                   node_vector       ( void );
00165         explicit                  node_vector       ( size_t uiSize);
00166                                   node_vector       ( const node_vector &obj);
00167         virtual                   ~node_vector      ( void );
00168 
00169         // Element access
00170         // ---------------------------------------------------------------------------
00171     public:
00172         virtual void              assign            ( size_t n, const T &val );
00173         virtual void              clear             ( void );
00174         virtual iterator          erase             ( iterator pos );
00175         virtual T &               at                ( size_t uiIndex );
00176         virtual const T &         at                ( size_t uiIndex )        const;
00177         virtual T &               back              ( void );
00178         virtual const T &         back              ( void )                  const;
00179         virtual iterator          begin             ( void );
00180         virtual const_iterator    begin             ( void )                  const;
00181         virtual size_t            capacity          ( void )                  const;
00182         virtual iterator          end               ( void );
00183         virtual const_iterator    end               ( void )                  const;
00184         virtual T &               front             ( void );
00185         virtual const T &         front             ( void )                  const;
00186         virtual size_t            max_size          ( void )                  const;
00187         virtual size_t            size              ( void )                  const;
00188         virtual iterator          insert            ( iterator pos,  const T& val) ;
00189         virtual bool              empty             ( void )                  const;
00190         virtual void              pop_back          ( void );
00191         virtual void              push_back         ( const T &val );
00192         virtual void              resize            ( size_t uiSize );
00193         virtual void              reserve           ( size_t uiSize );
00194 
00195         // Do not use - only left in for backwards compatibility!
00196         virtual void              erase             (size_t uiIndex);
00197         virtual void              insert            (size_t uiIndex, const T &val);
00198 
00199 // Operators
00200         // ---------------------------------------------------------------------------
00201     public:
00202         node_vector &             operator =        ( const node_vector &obj );
00203         T &                       operator []       ( size_t uiIndex );
00204         const T &                 operator []       ( size_t uiIndex )        const;
00205         void                      operator delete   ( void *pWhere );
00206         void *                    operator new      ( size_t uiSize );
00207 
00208         // Member
00209         // ---------------------------------------------------------------------------
00210     private:
00211        typedef std::vector<T, std::allocator<T> > vector_t;
00212        vector_t *_pv;
00213     };
00214 
00215 
00216 
00217     //*************************************************************
00218     // V A L U E _ V E C T O R
00219     //*************************************************************
00220 
00225     class GENAPI_DECL value_vector
00226     {
00227         typedef IValue* T;
00228         // Nested types
00229         // ---------------------------------------------------------------------------
00230     public:
00231         class GENAPI_DECL const_iterator
00232         {
00233             // iterator traits
00234             // ------------------------------------------------------------------------
00235         public:
00236             typedef std::random_access_iterator_tag iterator_category;
00237             typedef T value_type;
00238             typedef ptrdiff_t difference_type;
00239             typedef T* pointer;
00240             typedef T& reference;
00241 
00242             // Ctor / Dtor
00243             // -------------------------------------------------------------------------
00244         public:
00245             const_iterator    ( T *pPtr = 0 );
00246 
00247             // Operators
00248             // -------------------------------------------------------------------------
00249         public:
00250             const T &               operator *        ( void )                  const;
00251             const_iterator &        operator ++       ( void );
00252             const_iterator          operator ++       ( int );
00253             const_iterator &        operator --       ( void );
00254             const_iterator          operator --       ( int );
00255             const_iterator &        operator +=       ( intptr_t iInc );
00256             const_iterator          operator +=       ( intptr_t iInc )         const;
00257             const_iterator          operator +        ( intptr_t iInc )         const;
00258             const_iterator &        operator -=       ( intptr_t iDec );
00259             const_iterator          operator -=       ( intptr_t iDec )         const;
00260             intptr_t                operator -        ( const const_iterator &iter ) const;
00261             const_iterator          operator -        ( intptr_t iDec )         const;
00262             const T &               operator []       ( intptr_t iIndex )       const;
00263             bool                    operator ==       ( const const_iterator &iter ) const;
00264             bool                    operator !=       ( const const_iterator &iter ) 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             GENAPI_DECL
00270             friend const_iterator   operator +        ( intptr_t iInc, const const_iterator &iter);
00271 
00272             // Member
00273             // -------------------------------------------------------------------------
00274         protected:
00275             T *              _ps;
00276         };
00277 
00278         class GENAPI_DECL iterator :
00279             public const_iterator
00280         {
00281         public:
00282             // iterator traits
00283             // -------------------------------------------------------------------------
00284             typedef std::random_access_iterator_tag iterator_category;
00285             typedef T value_type;
00286             typedef const_iterator::difference_type difference_type;
00287             typedef const_iterator::pointer pointer;
00288             typedef const_iterator::reference reference;
00289             // Ctor / Dtor
00290             // -------------------------------------------------------------------------
00291         public:
00292             iterator          ( T *pPtr = 0 );
00293 
00294             // Operators
00295             // -------------------------------------------------------------------------
00296         public:
00297             T &                     operator *        ( void )                  const;
00298             iterator &              operator ++       ( void );
00299             iterator                operator ++       ( int );
00300             iterator &              operator --       ( void );
00301             iterator                operator --       ( int );
00302             iterator &              operator +=       ( intptr_t iInc );
00303             iterator                operator +=       ( intptr_t iInc )         const;
00304             iterator                operator +        ( intptr_t iInc )         const;
00305             iterator &              operator -=       ( intptr_t iDec );
00306             iterator                operator -=       ( intptr_t iDec )         const;
00307             intptr_t                operator -        ( const iterator &iter )  const;
00308             iterator                operator -        ( intptr_t iDec )         const;
00309             T &                     operator []       ( intptr_t iIndex )       const;
00310             GENAPI_DECL
00311             friend iterator         operator +        ( intptr_t iInc, const iterator &iter);
00312         };
00313 
00314         // Ctor / Dtor
00315         // ---------------------------------------------------------------------------
00316     public:
00317         value_vector   ( void );
00318         explicit                  value_vector   ( size_t uiSize);
00319         value_vector   ( const value_vector &obj);
00320         virtual                   ~value_vector  ( void );
00321 
00322         // Element access
00323         // ---------------------------------------------------------------------------
00324     public:
00325         virtual void              assign            ( size_t n, const T &obj );
00326         virtual void              clear             ( void );
00327         virtual iterator          erase             ( iterator pos );
00328         virtual T &               at                ( size_t uiIndex );
00329         virtual const T &         at                ( size_t uiIndex )        const;
00330         virtual T &               back              ( void );
00331         virtual const T &         back              ( void )                  const;
00332         virtual iterator          begin             ( void );
00333         virtual const_iterator    begin             ( void )                  const;
00334         virtual size_t            capacity          ( void )                  const;
00335         virtual iterator          end               ( void );
00336         virtual const_iterator    end               ( void )                  const;
00337         virtual T &               front             ( void );
00338         virtual const T &         front             ( void )                  const;
00339         virtual size_t            max_size          ( void )                  const;
00340         virtual size_t            size              ( void )                  const;
00341         virtual iterator          insert            ( iterator pos,  const T& val) ;
00342         virtual bool              empty             ( void )                  const;
00343         virtual void              pop_back          ( void );
00344         virtual void              push_back         ( const T &val );
00345         virtual void              resize            ( size_t uiSize, const T &val );
00346         virtual void              reserve           ( size_t uiSize );
00347 
00348 
00349         // Do not use - only left in for backwards compatibility!
00350         virtual void              erase             (size_t uiIndex);
00351         virtual void              insert            (size_t uiIndex, const T &val);
00352 
00353 // Operators
00354         // ---------------------------------------------------------------------------
00355     public:
00356         value_vector &            operator =        ( const value_vector &obj );
00357         T &                       operator []       ( size_t uiIndex );
00358         const T &                 operator []       ( size_t uiIndex )        const;
00359         void                      operator delete   ( void *pWhere );
00360         void *                    operator new      ( size_t uiSize );
00361 
00362         // Member
00363         // ---------------------------------------------------------------------------
00364     private:
00365        typedef std::vector<T, std::allocator<T> > vector_t;
00366        vector_t *_pv;
00367     };
00368 
00370     typedef value_vector FeatureList_t;
00371 } // namespace GenApi;
00372 
00373 
00374 #else
00375 #   error Unknown platform
00376 #endif
00377 
00378 #endif // GENICAM_GENAPI_NODEVECTOR_H


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:02