michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #pragma once michael@0: michael@0: #include michael@0: #include "base/linked_ptr.h" michael@0: #include "nsAutoPtr.h" michael@0: michael@0: #ifndef DECLARE_PTR michael@0: #define DECLARE_PTR(className)\ michael@0: class className;\ michael@0: typedef linked_ptr className##Ptr; michael@0: #endif michael@0: michael@0: michael@0: #ifndef DECLARE_PTR_VECTOR michael@0: #define DECLARE_PTR_VECTOR(className)\ michael@0: DECLARE_PTR(className)\ michael@0: typedef std::vector className##Vtr;\ michael@0: typedef linked_ptr className##Vtr##Ptr; michael@0: #endif michael@0: michael@0: michael@0: #ifndef NULL_PTR michael@0: #define NULL_PTR(className) linked_ptr() michael@0: #endif michael@0: michael@0: // NSPR Variations of the above, to help with migration michael@0: // from linked_ptr to nsRefPtr michael@0: #ifndef DECLARE_NS_PTR michael@0: #define DECLARE_NS_PTR(className)\ michael@0: class className;\ michael@0: typedef nsRefPtr className##Ptr; michael@0: #endif michael@0: michael@0: michael@0: #ifndef DECLARE_NS_PTR_VECTOR michael@0: #define DECLARE_NS_PTR_VECTOR(className)\ michael@0: DECLARE_NS_PTR(className)\ michael@0: typedef std::vector className##Vtr;\ michael@0: typedef linked_ptr className##Vtr##Ptr; michael@0: #endif