00001
00002
00003
00004
00005
00006
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