Lines Matching refs:Type

45 // Default traits for Singleton<Type>. Calls operator new and operator delete on
48 template<typename Type>
51 static Type* New() {
54 return new Type();
58 static void Delete(Type* x) {
75 // Alternate traits for use with the Singleton<Type>. Identical to
78 template<typename Type>
79 struct LeakySingletonTraits : public DefaultSingletonTraits<Type> {
87 // Alternate traits for use with the Singleton<Type>. Allocates memory
108 template <typename Type>
112 static Type* New() {
117 return new(buffer_.void_data()) Type();
120 static void Delete(Type* p) {
122 p->Type::~Type();
134 static base::AlignedMemory<sizeof(Type), ALIGNOF(Type)> buffer_;
139 template <typename Type> base::AlignedMemory<sizeof(Type), ALIGNOF(Type)>
140 StaticMemorySingletonTraits<Type>::buffer_;
141 template <typename Type> base::subtle::Atomic32
142 StaticMemorySingletonTraits<Type>::dead_ = 0;
144 // The Singleton<Type, Traits, DifferentiatingType> class manages a single
145 // instance of Type which will be created on first use and will be destroyed at
186 // This class is itself thread-safe. The underlying Type must of course be
213 template <typename Type,
214 typename Traits = DefaultSingletonTraits<Type>,
215 typename DifferentiatingType = Type>
220 friend Type* Type::GetInstance();
229 static Type* get() {
242 return reinterpret_cast<Type*>(value);
251 Type* newval = Traits::New();
272 return reinterpret_cast<Type*>(value);
282 reinterpret_cast<Type*>(base::subtle::NoBarrier_Load(&instance_)));
288 template <typename Type, typename Traits, typename DifferentiatingType>
289 base::subtle::AtomicWord Singleton<Type, Traits, DifferentiatingType>::