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