Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxPixelAllocator.h

00001 /*
00002  *  Copyright (c) 2000, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *  Author(s):
00006  *  Edo Poll (poll@wins.uva.nl)
00007  */
00008 
00009 #ifndef HxPixelAllocator_h
00010 #define HxPixelAllocator_h
00011 
00012 #include <stddef.h>
00013 
00014 
00017 template<class PixelT>
00018 class HxPixelAllocator
00019 {
00020 public:
00021                             HxPixelAllocator();
00022                             ~HxPixelAllocator();
00023 
00024     typedef PixelT*         pointer;
00025     typedef const PixelT*   const_pointer;
00026     typedef PixelT&         reference;
00027     typedef const PixelT&   const_reference;
00028 
00029     typedef PixelT          value_type;
00030     typedef size_t          size_type;
00031 
00032     pointer                 address(reference x);
00033     const_pointer           const_address(const_reference x);
00034 
00035     pointer                 allocate(size_type n);
00036     void                    deallocate(pointer p, size_type n = 0);
00037 };
00038 
00039 template<class PixelT>
00040 inline typename HxPixelAllocator<PixelT>::pointer
00041 HxPixelAllocator<PixelT>::address(reference x)
00042 {
00043     return &x;
00044 }
00045 
00046 template<class PixelT>
00047 inline typename HxPixelAllocator<PixelT>::const_pointer
00048 HxPixelAllocator<PixelT>::const_address(const_reference x)
00049 {
00050     return &x;
00051 }
00052 
00053 #ifdef INC_TEMPLATE_SRC
00054 #include "HxPixelAllocator.c"
00055 #endif
00056 
00057 #endif

Generated on Tue Feb 3 14:18:40 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001