00001 // Filename: pdeque.h 00002 // Created by: drose (05Jun01) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef PDEQUE_H 00020 #define PDEQUE_H 00021 00022 #include "dtoolbase.h" 00023 #include "pallocator.h" 00024 #include <deque> 00025 00026 #ifdef NO_STYLE_ALLOCATOR 00027 // If we're not using custom allocators, just use the standard class 00028 // definition. 00029 #define pdeque deque 00030 00031 #else 00032 00033 //////////////////////////////////////////////////////////////////// 00034 // Class : pdeque 00035 // Description : This is our own Panda specialization on the default 00036 // STL deque. Its main purpose is to call the hooks 00037 // for MemoryUsage to properly track STL-allocated 00038 // memory. 00039 //////////////////////////////////////////////////////////////////// 00040 template<class Type> 00041 class pdeque : public deque<Type, pallocator<Type> > { 00042 public: 00043 typedef TYPENAME deque<Type, pallocator<Type> >::size_type size_type; 00044 pdeque() : deque<Type, pallocator<Type> >() { } 00045 pdeque(const pdeque<Type> ©) : deque<Type, pallocator<Type> >(copy) { } 00046 pdeque(size_type n) : deque<Type, pallocator<Type> >(n) { } 00047 pdeque(size_type n, const Type &value) : deque<Type, pallocator<Type> >(n, value) { } 00048 }; 00049 00050 #endif // NO_STYLE_ALLOCATOR 00051 #endif