29#ifndef _CEGUIMemorySTLWrapper_h_
30#define _CEGUIMemorySTLWrapper_h_
32#ifndef _CEGUIMemoryAllocation_h_
33# error Dont include this directly! Include CEGUIBase.h instead.
39#ifdef CEGUI_CUSTOM_ALLOCATORS
42struct STLAllocatorWrapperBase
48struct STLAllocatorWrapperBase<const T>
53template <
typename T,
typename Allocator>
54class STLAllocatorWrapper :
public STLAllocatorWrapperBase<T>
57 typedef STLAllocatorWrapperBase<T> Base;
58 typedef typename Base::value_type value_type;
60 typedef value_type* pointer;
61 typedef const value_type* const_pointer;
62 typedef value_type& reference;
63 typedef const value_type& const_reference;
65 typedef std::size_t size_type;
66 typedef std::ptrdiff_t difference_type;
71 typedef STLAllocatorWrapper<U, Allocator> other;
74 inline explicit STLAllocatorWrapper()
77 inline STLAllocatorWrapper(
const STLAllocatorWrapper&)
80 template <
typename U,
typename P>
81 inline STLAllocatorWrapper(
const STLAllocatorWrapper<U, P>&)
84 inline pointer address(reference x)
const
89 inline const_pointer address(const_reference x)
const
94 inline size_type max_size()
const throw()
96 return Allocator::getMaxAllocationSize();
99 inline pointer allocate(size_type count,
typename std::allocator<void>::const_pointer ptr = 0)
102 return static_cast<pointer
>(Allocator::allocateBytes(count *
sizeof(T)));
105 inline void deallocate(pointer ptr, size_type )
107 Allocator::deallocateBytes(ptr);
110 inline void construct(pointer p,
const T& val)
112 new(
static_cast<void*
>(p)) T(val);
115 inline void destroy(pointer p)
121template<
typename T,
typename T2,
typename P>
122inline bool operator==(
const STLAllocatorWrapper<T, P>&,
const STLAllocatorWrapper<T2, P>&)
128template<
typename T,
typename P,
typename OtherAllocator>
129inline bool operator==(
const STLAllocatorWrapper<T, P>&,
const OtherAllocator&)
135template<
typename T,
typename T2,
typename P>
136inline bool operator!=(
const STLAllocatorWrapper<T, P>&,
const STLAllocatorWrapper<T2,P>&)
142template<
typename T,
typename P,
typename OtherAllocator>
143inline bool operator!=(
const STLAllocatorWrapper<T, P>&,
const OtherAllocator&)
150#define CEGUI_VECTOR_ALLOC(T) , ::CEGUI::STLAllocatorWrapper<T, ::CEGUI::AllocatorConfig< ::CEGUI::STLAllocator >::Allocator>
151#define CEGUI_SET_ALLOC(T) , ::CEGUI::STLAllocatorWrapper<T, ::CEGUI::AllocatorConfig< ::CEGUI::STLAllocator >::Allocator>
152#define CEGUI_MAP_ALLOC(K, V) , ::CEGUI::STLAllocatorWrapper<std::pair<K, V>, ::CEGUI::AllocatorConfig< ::CEGUI::STLAllocator >::Allocator>
153#define CEGUI_MULTIMAP_ALLOC(K, V) , ::CEGUI::STLAllocatorWrapper<std::pair<K, V>, ::CEGUI::AllocatorConfig< ::CEGUI::STLAllocator >::Allocator>
158#define CEGUI_VECTOR_ALLOC(T)
159#define CEGUI_SET_ALLOC(T)
160#define CEGUI_MAP_ALLOC(K, V)
161#define CEGUI_MULTIMAP_ALLOC(K, V)
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
bool CEGUIEXPORT operator!=(const String &str1, const String &str2)
Return true if String str1 is not equal to String str2.
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.