Lines Matching refs:Traits

114  * by the Traits class. The backing map will handle values of type
118 template<typename K, typename V, typename Traits>
130 size_t Size() { return Traits::Size(&impl_); }
135 bool IsWeak() { return Traits::kCallbackType != kNotWeak; }
141 return Local<V>::New(isolate_, FromVal(Traits::Get(&impl_, key)));
148 return Traits::Get(&impl_, key) != kPersistentContainerNotFound;
157 return SetReturnValueFromVal(&returnValue, Traits::Get(&impl_, key));
167 reinterpret_cast<internal::Object**>(FromVal(Traits::Get(&impl_, key))));
171 * Put value into map. Depending on Traits::kIsWeak, the value will be held
191 return Release(Traits::Remove(&impl_, key)).Pass();
199 typedef typename Traits::Iterator It;
202 while (!Traits::Empty(&impl_)) {
203 typename Traits::Impl impl;
204 Traits::Swap(impl_, impl);
205 for (It i = Traits::Begin(&impl); i != Traits::End(&impl); ++i) {
206 Traits::Dispose(isolate_, Release(Traits::Value(i)).Pass(),
207 Traits::Key(i));
263 return PersistentValueReference(Traits::Get(&impl_, key));
282 * by the Traits class.
285 if (Traits::kCallbackType != kNotWeak) {
287 persistent->template SetWeak<typename Traits::WeakCallbackDataType>(
288 Traits::WeakCallbackParameter(this, key, value), WeakCallback);
291 Traits::Set(&impl_, key, ClearAndLeak(persistent));
296 const WeakCallbackData<V, typename Traits::WeakCallbackDataType>& data) {
297 if (Traits::kCallbackType != kNotWeak) {
298 PersistentValueMap<K, V, Traits>* persistentValueMap =
299 Traits::MapFromWeakCallbackData(data);
300 K key = Traits::KeyFromWeakCallbackData(data);
301 Traits::Dispose(data.GetIsolate(),
303 Traits::DisposeCallbackData(data.GetParameter());
341 if (Traits::kCallbackType != kNotWeak && p.IsWeak()) {
342 Traits::DisposeCallbackData(
343 p.template ClearWeak<typename Traits::WeakCallbackDataType>());
349 typename Traits::Impl impl_;
361 typename Traits = DefaultPersistentValueMapTraits<K, V> >
362 class StdPersistentValueMap : public PersistentValueMap<K, V, Traits> {
365 : PersistentValueMap<K, V, Traits>(isolate) {}
400 * are described by the Traits class. The backing map will handle values of type
404 template<typename V, typename Traits = DefaultPersistentValueVectorTraits>
418 Traits::Append(&impl_, ClearAndLeak(&persistent));
425 Traits::Append(&impl_, ClearAndLeak(&persistent));
432 return Traits::IsEmpty(&impl_);
439 return Traits::Size(&impl_);
446 return Local<V>::New(isolate_, FromVal(Traits::Get(&impl_, index)));
453 size_t length = Traits::Size(&impl_);
456 p.val_ = FromVal(Traits::Get(&impl_, i));
458 Traits::Clear(&impl_);
466 Traits::ReserveCapacity(&impl_, capacity);
482 typename Traits::Impl impl_;