libebml_ng
ptrs.h
Go to the documentation of this file.
1 #ifndef EBML_NG_PTRS_H
2 #define EBML_NG_PTRS_H
3 
4 #include <utility>
5 #include "forwards.h"
6 #include <memory>
7 #include <mutex>
8 #include <iostream>
9 
10 namespace ebml {
19  struct control_block {
20  std::mutex mutex;
21  long long strongcount = 0;
22  long long weakcount = 0;
23  bool valid = false;
24  };
25 
26  template<typename T>
28 
29  template<typename T>
31 
36  template<typename T, typename U>
38 
39  template<typename T, typename U>
41 
42  template<typename T, typename U>
44 
45  template<typename T, typename U>
47 
48  template<typename T, typename U>
50 
51  template<typename T, typename U>
53 
54  template<typename T, typename U>
56 
57  template<typename T, typename U>
59 
96  template<typename T>
97  class ebml_shared_ptr {
98  friend T;
99 
100  template<typename U, typename V>
102 
103  template<typename U, typename V>
105 
106  template<typename U, typename V>
108 
109  template<typename U, typename V>
111 
112  template<typename U, typename V>
114 
115  template<typename U, typename V>
117 
118  protected:
119  mutable std::mutex mutex;
120  mutable control_block* ctl = nullptr;
121  T* ptr = nullptr;
122 
123  private:
124 
125  void _incref(control_block& ctl) {
126  auto lock = std::unique_lock<std::mutex>(ctl.mutex);
127  ++ctl.strongcount;
128  }
129 
130  bool _decref(control_block& ctl) {
131  bool deleteobj = false;
132  bool deletectl = false;
133 
134  {
135  auto lock = std::unique_lock<std::mutex>(ctl.mutex);
136 
137  if (--ctl.strongcount <= 0) {
138  if (ctl.valid) {
139  ctl.valid = false;
140  deleteobj = true;
141  }
142 
143  deletectl = (ctl.weakcount <= 0);
144  }
145 
146  }
147 
148  if (deleteobj) {
149  delete ptr;
150  ptr = nullptr;
151  }
152 
153  return deletectl;
154  }
155 
156  void _destroyctl() {
157  delete ctl;
158  ctl = nullptr;
159  ptr = nullptr;
160  }
161 
162  protected:
164  if (ctl != nullptr) {
165  _incref(*ctl);
166  }
167  };
168 
169  explicit ebml_shared_ptr(control_block* ctl, T* ptr, const std::unique_lock<std::mutex>&) : ctl(ctl), ptr(ptr) {
170  if (ctl != nullptr) {
171  ++ctl->strongcount;
172  }
173  };
174 
175  public:
176  ebml_shared_ptr() : ebml_shared_ptr(nullptr, nullptr) {}
177  ebml_shared_ptr(const std::nullptr_t&) : ebml_shared_ptr(nullptr, nullptr) {}
178 
189  ctl->valid = true;
190  };
191 
193  auto lock = std::unique_lock<std::mutex>(other.mutex);
194 
195  if (other.ctl != nullptr) {
196  this->ctl = other.ctl;
197  this->ptr = other.ptr;
198  _incref(*ctl);
199  }
200  }
201 
202  template <class U>
204  auto lock = std::unique_lock<std::mutex>(other.mutex);
205 
206  if (other.ctl != nullptr) {
207  this->ctl = other.ctl;
208  this->ptr = other.ptr;
209  _incref(*ctl);
210  }
211  }
212 
214  auto lock = std::unique_lock<std::mutex>(other.mutex);
215 
216  if (other.ctl != nullptr) {
217  this->ctl = std::exchange(other.ctl, nullptr);
218  this->ptr = std::exchange(other.ptr, nullptr);
219  }
220  }
221 
223  auto lock = std::unique_lock<std::mutex>(mutex);
224 
225  if (ctl != nullptr) {
226  if (_decref(*ctl)) {
227  _destroyctl();
228  }
229  }
230  }
231 
233  if (&other == this) {
234  return *this;
235  }
236 
237  using l = std::unique_lock<std::mutex>;
238  using p = std::pair<l, l>;
239  p lockpair = (&mutex < &other.mutex) ? p({l(mutex), l(other.mutex)}) : p({l(other.mutex), l(mutex)});
240 
241  if (other.ctl == ctl) {
242  return *this;
243  }
244 
245  if (ctl != nullptr) {
246  if (_decref(*ctl)) {
247  _destroyctl();
248  }
249  }
250 
251  ctl = other.ctl;
252  ptr = other.ptr;
253 
254  if (ctl != nullptr) {
255  _incref(*ctl);
256  }
257 
258  return *this;
259  }
260 
262  if (&other == this) {
263  return *this;
264  }
265 
266  using l = std::unique_lock<std::mutex>;
267  using p = std::pair<l, l>;
268  p lockpair = (&mutex < &other.mutex) ? p({l(mutex), l(other.mutex)}) : p({l(other.mutex), l(mutex)});
269 
270  if (other.ctl == ctl) {
271  if (ctl != nullptr) {
272  _decref(*ctl);
273  }
274 
275  other.ctl = nullptr;
276  other.ptr = nullptr;
277  return *this;
278  }
279 
280  if (ctl != nullptr) {
281  if (_decref(*ctl)) {
282  _destroyctl();
283  }
284  }
285 
286  ctl = std::exchange(other.ctl, nullptr);
287  ptr = std::exchange(other.ptr, nullptr);
288 
289  return *this;
290  }
291 
292  ebml_shared_ptr<T>& operator=(const std::nullptr_t&) {
293  auto lock = std::unique_lock<std::mutex>(mutex);
294 
295  if (ctl != nullptr) {
296  if (_decref(*ctl)) {
297  _destroyctl();
298  }
299  }
300 
301  ctl = nullptr;
302  ptr = nullptr;
303  return *this;
304  }
305 
306  bool operator==(const std::nullptr_t&) const {
307  auto lock = std::unique_lock<std::mutex>(mutex);
308 
309  if (ctl == nullptr) {
310  return true;
311  }
312 
313  if (ptr == nullptr) {
314  return true;
315  }
316 
317  return !ctl->valid;
318  }
319 
320  bool operator==(const ebml_shared_ptr<T>& other) const {
321  using l = std::unique_lock<std::mutex>;
322  using p = std::pair<l, l>;
323  p lockpair = (&mutex < &other.mutex) ? p({l(mutex), l(other.mutex)}) : p({l(other.mutex), l(mutex)});
324 
325  if ((ctl == nullptr) and other.ctl == nullptr) {
326  return true;
327  }
328 
329  return (ptr == other.ptr);
330  }
331 
332  template<typename U>
333  std::enable_if_t<!std::is_same<T, U>::value, ebml_shared_ptr<T>&>
335  using l = std::unique_lock<std::mutex>;
336  using p = std::pair<l, l>;
337  p lockpair = (&mutex < &other.mutex) ? p({l(mutex), l(other.mutex)}) : p({l(other.mutex), l(mutex)});
338 
339  if (other.ctl == ctl) {
340  return *this;
341  }
342 
343  if (ctl != nullptr) {
344  if (_decref(*ctl)) {
345  _destroyctl();
346  }
347  }
348 
349  if (other.ctl != nullptr) {
350  if (auto recast = dynamic_cast<T*>(other.ptr)) {
351  ctl = other.ctl;
352  ptr = recast;
353  _incref(*ctl);
354  } else {
355  ctl = nullptr;
356  ptr = nullptr;
357  }
358  } else {
359  ctl = nullptr;
360  ptr = nullptr;
361  }
362 
363  return *this;
364  }
365 
366  void swap(ebml_shared_ptr<T>& other) {
367  if (&other == this) {
368  return;
369  }
370 
371  using l = std::unique_lock<std::mutex>;
372  using p = std::pair<l, l>;
373  p lockpair = (&mutex < &other.mutex) ? p({l(mutex), l(other.mutex)}) : p({l(other.mutex), l(mutex)});
374 
375  if (other.ctl == ctl) {
376  return;
377  }
378 
379  this->ctl = std::exchange(other.ctl, ctl);
380  this->ptr = std::exchange(other.ptr, ptr);
381  }
382 
391  T* get() const {
392  auto lock = std::unique_lock<std::mutex>(mutex);
393 
394  if (ctl != nullptr) {
395  if (ctl->valid) {
396  return this->ptr;
397  }
398  }
399 
400  return nullptr;
401  }
402  T& operator*() const {
403  T* ret = nullptr;
404 
405  auto lock = std::unique_lock<std::mutex>(mutex);
406 
407  if (ctl != nullptr) {
408  if (ctl->valid) {
409  return *this->ptr;
410  }
411  }
412 
413  // Deliberately dereference nullptr
414  return *ret;
415  }
416 
417  T* operator->() const {
418  auto lock = std::unique_lock<std::mutex>(mutex);
419 
420  if (ctl != nullptr) {
421  if (ctl->valid) {
422  return this->ptr;
423  }
424  }
425 
426  return nullptr;
427  }
428 
429  explicit operator bool() const {
430  auto lock = std::unique_lock<std::mutex>(mutex);
431  return ((ctl != nullptr) and (ptr != nullptr) and (ctl->valid));
432  }
433 
434  int use_count() const {
435  auto lock = std::unique_lock<std::mutex>(mutex);
436 
437  if (ctl != nullptr) {
438  return ctl->strongcount;
439  }
440 
441  return 0;
442  }
443 
444  template<typename U>
445  friend class ebml_shared_ptr;
446 
447  template<typename U>
448  friend class ebml_weak_ptr;
449  };
450 
460  template <class T>
461  class ebml_weak_ptr {
462  friend T;
463 
464  template<typename U, typename V>
466 
467  template<typename U, typename V>
469 
470  protected:
471  mutable std::mutex mutex;
472  mutable control_block* ctl = nullptr;
473  T* ptr = nullptr;
474 
475  private:
476  void _incref(control_block& ctl) {
477  auto lock = std::unique_lock<std::mutex>(ctl.mutex);
478  ++ctl.weakcount;
479  }
480 
481  bool _decref(control_block& ctl) {
482  auto lock = std::unique_lock<std::mutex>(ctl.mutex);
483  --ctl.weakcount;
484  return (ctl.strongcount <= 0) and (ctl.weakcount <= 0);
485  }
486 
487  void _destroyctl() {
488  delete ctl;
489  ctl = nullptr;
490  ptr = nullptr;
491  }
492 
493  protected:
494  explicit ebml_weak_ptr(control_block* ctl, T* ptr) : ctl(ctl), ptr(ptr) {
495  if (ctl != nullptr) {
496  _incref(*ctl);
497  }
498  };
499 
500  public:
501  ebml_weak_ptr() : ebml_weak_ptr(nullptr) {}
502  ebml_weak_ptr(const std::nullptr_t&) : ebml_weak_ptr(nullptr, nullptr) {}
503 
504  explicit ebml_weak_ptr(const ebml_shared_ptr<T>& sharedPtr) {
505  auto lock = std::unique_lock<std::mutex>(sharedPtr.mutex);
506 
507  ctl = sharedPtr.ctl;
508  ptr = sharedPtr.ptr;
509 
510  if (ctl != nullptr) {
511  _incref(*ctl);
512  }
513  }
514 
516  auto lock = std::unique_lock<std::mutex>(other.mutex);
517 
518  ctl = other.ctl;
519  ptr = other.ptr;
520 
521  if (ctl != nullptr) {
522  _incref(*ctl);
523  }
524  }
525 
527  auto lock = std::unique_lock<std::mutex>(other.mutex);
528 
529  ctl = std::exchange(other.ctl, nullptr);
530  ptr = std::exchange(other.ptr, nullptr);
531  }
532 
534  if (&other == this) {
535  return *this;
536  }
537 
538  using l = std::unique_lock<std::mutex>;
539  using p = std::pair<l, l>;
540  p lockpair = (&mutex < &other.mutex) ? p({l(mutex), l(other.mutex)}) : p({l(other.mutex), l(mutex)});
541 
542  if (other.ctl == ctl) {
543  return *this;
544  }
545 
546  if (ctl != nullptr) {
547  if (_decref(*ctl)) {
548  _destroyctl();
549  }
550  }
551 
552  if (other.ctl != nullptr) {
553  this->ctl = other.ctl;
554  this->ptr = other.ptr;
555  _incref(*ctl);
556  }
557 
558  return *this;
559  }
560 
562  if (&other == this) {
563  return *this;
564  }
565 
566  using l = std::unique_lock<std::mutex>;
567  using p = std::pair<l, l>;
568  p lockpair = (&mutex < &other.mutex) ? p({l(mutex), l(other.mutex)}) : p({l(other.mutex), l(mutex)});
569 
570  if (other.ctl == ctl) {
571  if (ctl != nullptr) {
572  _decref(*ctl);
573  }
574 
575  other.ctl = nullptr;
576  other.ptr = nullptr;
577  return *this;
578  }
579 
580  if (ctl != nullptr) {
581  if (_decref(*ctl)) {
582  _destroyctl();
583  }
584  }
585 
586  if (other.ctl != nullptr) {
587  this->ctl = std::exchange(other.ctl, nullptr);
588  this->ptr = std::exchange(other.ptr, nullptr);
589  }
590 
591  return *this;
592  }
593 
595  auto lock = std::unique_lock<std::mutex>(mutex);
596 
597  if (ctl != nullptr) {
598  if (_decref(*ctl)) {
599  _destroyctl();
600  }
601  }
602  }
603 
605  auto lock = std::unique_lock<std::mutex>(mutex);
606 
607  if (ctl != nullptr) {
608  auto& c = *ctl;
609  auto lock = std::unique_lock<std::mutex>(c.mutex);
610  return ebml_shared_ptr<T>(ctl, ptr, lock);
611  }
612 
613  return ebml_shared_ptr<T>();
614  }
615 
617  auto lock = std::unique_lock<std::mutex>(mutex);
618 
619  if (ctl != nullptr) {
620  auto& c = *ctl;
621  auto lock = std::unique_lock<std::mutex>(c.mutex);
623  }
624 
625  return ebml_shared_ptr<const T>();
626  }
627 
628  template<typename U>
630  auto lock = std::unique_lock<std::mutex>(mutex);
631 
632  if (ctl != nullptr) {
633  auto& c = *ctl;
634  auto lock = std::unique_lock<std::mutex>(c.mutex);
635 
636  if (auto recast = dynamic_cast<U*>(ptr)) {
637  return ebml_shared_ptr<U>(ctl, recast, lock);
638  }
639  }
640 
641  return ebml_shared_ptr<U>();
642  }
643 
644  template<typename U>
645  std::enable_if_t<!std::is_same<T, U>::value, ebml_shared_ptr<U>> c_lock() const {
646  auto lock = std::unique_lock<std::mutex>(mutex);
647 
648  if (ctl != nullptr) {
649  auto& c = *ctl;
650  auto lock = std::unique_lock<std::mutex>(c.mutex);
651 
652  const T* cptr = ptr;
653 
654  if (auto recast = dynamic_cast<U*>(cptr)) {
655  return ebml_shared_ptr<U>(ctl, recast, lock);
656  }
657  }
658 
659  return ebml_shared_ptr<U>();
660  }
661 
662  bool expired() const {
663  auto lock = std::unique_lock<std::mutex>(mutex);
664 
665  if (ctl != nullptr) {
666  auto& c = *ctl;
667  auto lock = std::unique_lock<std::mutex>(c.mutex);
668  return !c.valid;
669  }
670 
671  return true;
672  }
673  };
674 
675  template<typename T, typename U>
677  {
678  auto lock = std::unique_lock<std::mutex>(other.mutex);
679 
680  if (other.ctl != nullptr) {
681  auto recast = dynamic_cast<T*>(other.ptr);
682 
683  if (recast != nullptr) {
684  return ebml_shared_ptr<T>(other.ctl, recast);
685  }
686  }
687  }
688 
689  return ebml_shared_ptr<T>();
690  }
691 
692  template<typename T, typename U>
694  {
695  auto lock = std::unique_lock<std::mutex>(other.mutex);
696 
697  if (other.ctl != nullptr) {
698  auto recast = dynamic_cast<T*>(other.ptr);
699 
700  if (recast != nullptr) {
701  ebml_shared_ptr<T> result;
702  result.ctl = std::exchange(other.ctl, nullptr);
703  result.ptr = recast;
704  other.ptr = nullptr;
705  return result;
706  }
707  }
708  }
709 
710  return ebml_shared_ptr<T>();
711  }
712 
713  template<typename T, typename U>
715  {
716  auto lock = std::unique_lock<std::mutex>(other.mutex);
717 
718  if (other.ctl != nullptr) {
719  auto recast = dynamic_cast<T*>(other.ptr);
720 
721  if (recast != nullptr) {
722  return ebml_weak_ptr<T>(other.ctl, recast);
723  }
724  }
725  }
726 
727  return ebml_weak_ptr<T>();
728  }
729 
730  template<typename T, typename U>
732  {
733  auto lock = std::unique_lock<std::mutex>(other.mutex);
734 
735  if (other.ctl != nullptr) {
736  auto recast = static_cast<T*>(other.ptr);
737  return ebml_shared_ptr<T>(other.ctl, recast);
738  }
739  }
740 
741  return ebml_shared_ptr<T>();
742  }
743 
744  template<typename T, typename U>
746  {
747  auto lock = std::unique_lock<std::mutex>(other.mutex);
748 
749  if (other.ctl != nullptr) {
750  auto recast = static_cast<T*>(other.ptr);
751  return ebml_weak_ptr<T>(other.ctl, recast);
752  }
753  }
754 
755  return ebml_weak_ptr<T>();
756  }
757 
758  template<typename T, typename U>
760  {
761  auto lock = std::unique_lock<std::mutex>(other.mutex);
762 
763  if (other.ctl != nullptr) {
764  auto recast = static_cast<T*>(other.ptr);
765  ebml_shared_ptr<T> result;
766  result.ctl = std::exchange(other.ctl, nullptr);
767  result.ptr = recast;
768  other.ptr = nullptr;
769  return result;
770  }
771  }
772 
773  return ebml_shared_ptr<T>();
774  }
775 
776  template<typename T, typename U>
778  {
779  auto lock = std::unique_lock<std::mutex>(other.mutex);
780 
781  if (other.ctl != nullptr) {
782  auto recast = const_cast<T*>(other.ptr);
783  return ebml_shared_ptr<T>(other.ctl, recast);
784  }
785  }
786 
787  return ebml_shared_ptr<T>();
788  }
789 
790  // template<typename T, typename U>
791  // ebml_weak_ptr<T> ebml_const_pointer_cast(const ebml_weak_ptr<U>& other) {
792  // {
793  // auto lock = std::unique_lock<std::mutex>(other.mutex);
794  //
795  // if (other.ctl != nullptr) {
796  // auto recast = const_cast<T*>(other.ptr);
797  // return ebml_weak_ptr<T>(other.ctl, recast);
798  // }
799  // }
800  //
801  // return ebml_weak_ptr<T>();
802  // }
803 
804  template<typename T, typename U>
806  {
807  auto lock = std::unique_lock<std::mutex>(other.mutex);
808 
809  if (other.ctl != nullptr) {
810  auto recast = const_cast<T*>(other.ptr);
811  ebml_shared_ptr<T> result;
812  result.ctl = std::exchange(other.ctl, nullptr);
813  result.ptr = recast;
814  other.ptr = nullptr;
815  return result;
816  }
817  }
818 
819  return ebml_shared_ptr<T>();
820  }
821  // template<typename T>
822  // using ptr = std::shared_ptr<T>;
823  //
824  // template<typename T>
825  // using wptr = std::weak_ptr<T>;
826 
827  template<typename T>
829 
830  template<typename T>
832 
838 
844 
850 
856 
857 
863 
869 
875 
881 
887 
893 
899 
909  typedef std::shared_ptr<ebmlDocument> ebmlDocument_sp;
910 
915  typedef std::weak_ptr<ebmlDocument> ebmlDocument_wp;
916 
922 }
923 #endif
ptr< const ebmlMasterElement > c_ebmlMasterElement_sp
Definition: ptrs.h:855
bool valid
Definition: ptrs.h:23
Definition: ptrs.h:19
friend ebml_shared_ptr< U > ebml_static_pointer_cast(const ebml_shared_ptr< V > &)
ebml_shared_ptr(const ebml_shared_ptr< U > &other)
Definition: ptrs.h:203
ebml_shared_ptr< U > lock() const
Definition: ptrs.h:629
ebml_shared_ptr< T > ebml_dynamic_pointer_cast(const ebml_shared_ptr< U > &)
Definition: ptrs.h:676
ebml_shared_ptr< const T > c_lock() const
Definition: ptrs.h:616
T * operator->() const
Definition: ptrs.h:417
friend ebml_weak_ptr< U > ebml_dynamic_pointer_cast(const ebml_weak_ptr< V > &)
bool expired() const
Definition: ptrs.h:662
wptr< const ebmlMasterElement > c_ebmlMasterElement_wp
Definition: ptrs.h:904
wptr< ebmlMasterElement > ebmlMasterElement_wp
Definition: ptrs.h:898
ebml_shared_ptr(control_block *ctl, T *ptr)
Definition: ptrs.h:163
ptr< ebmlElement > ebmlElement_sp
Definition: ptrs.h:837
friend ebml_shared_ptr< U > ebml_const_pointer_cast(const ebml_shared_ptr< V > &)
ebml_weak_ptr(const ebml_shared_ptr< T > &sharedPtr)
Definition: ptrs.h:504
std::weak_ptr< ebmlDocument > ebmlDocument_wp
Definition: ptrs.h:915
T * ptr
Definition: ptrs.h:121
bool operator==(const std::nullptr_t &) const
Definition: ptrs.h:306
ebml_shared_ptr< T > & operator=(ebml_shared_ptr< T > &&other)
Definition: ptrs.h:261
friend ebml_shared_ptr< U > ebml_dynamic_pointer_cast(const ebml_shared_ptr< V > &)
ebml_shared_ptr(const std::nullptr_t &)
Definition: ptrs.h:177
ebml_shared_ptr(control_block *ctl, T *ptr, const std::unique_lock< std::mutex > &)
Definition: ptrs.h:169
ptr< ebmlMasterElement > ebmlMasterElement_sp
Definition: ptrs.h:849
T & operator*() const
Definition: ptrs.h:402
A drop-in replacement for std::weak_ptr tailored for EBML objects.
Definition: ptrs.h:30
Definition: basictypes.h:40
A drop-in replacement for std::shared_ptr tailored for EBML objects.
Definition: ptrs.h:27
ebml_weak_ptr(const std::nullptr_t &)
Definition: ptrs.h:502
ebml_shared_ptr< T > lock() const
Definition: ptrs.h:604
wptr< const ebmlElement > c_ebmlElement_wp
Definition: ptrs.h:892
control_block * ctl
Definition: ptrs.h:472
long long weakcount
Definition: ptrs.h:22
ebml_shared_ptr()
Definition: ptrs.h:176
ebml_shared_ptr< T > & operator=(const ebml_shared_ptr< T > &other)
Definition: ptrs.h:232
T * ptr
Definition: ptrs.h:473
ebml_shared_ptr(T *ptr)
Constructs an ebml_shared_ptr that takes ownership of ptr.
Definition: ptrs.h:188
void swap(ebml_shared_ptr< T > &other)
Definition: ptrs.h:366
std::mutex mutex
Definition: ptrs.h:119
ebml_shared_ptr< T > & operator=(const std::nullptr_t &)
Definition: ptrs.h:292
int use_count() const
Definition: ptrs.h:434
std::shared_ptr< ebmlDocument > ebmlDocument_sp
Definition: ptrs.h:909
ebml_weak_ptr(ebml_weak_ptr< T > &&other)
Definition: ptrs.h:526
ptr< const ebmlElement > c_ebmlElement_sp
Definition: ptrs.h:843
ebml_weak_ptr< T > & operator=(ebml_weak_ptr< T > &&other)
Definition: ptrs.h:561
ebml_weak_ptr(const ebml_weak_ptr< T > &other)
Definition: ptrs.h:515
ptr< ebmlLazyLoad > ebmlLazyLoad_sp
Definition: ptrs.h:874
~ebml_shared_ptr()
Definition: ptrs.h:222
ptr< ioBase > ioBase_sp
Definition: ptrs.h:921
ebml_shared_ptr< T > ebml_static_pointer_cast(const ebml_shared_ptr< U > &)
Definition: ptrs.h:731
std::mutex mutex
Definition: ptrs.h:471
ebml_weak_ptr< T > & operator=(const ebml_weak_ptr< T > &other)
Definition: ptrs.h:533
~ebml_weak_ptr()
Definition: ptrs.h:594
std::mutex mutex
Definition: ptrs.h:20
control_block * ctl
Definition: ptrs.h:120
ebml_shared_ptr(ebml_shared_ptr< T > &&other)
Definition: ptrs.h:213
ebml_weak_ptr()
Definition: ptrs.h:501
ptr< const ebmlList > c_ebmlList_sp
Definition: ptrs.h:868
friend ebml_weak_ptr< U > ebml_static_pointer_cast(const ebml_weak_ptr< V > &)
ptr< const ebmlLazyLoad > c_ebmlLazyLoad_sp
Definition: ptrs.h:880
std::enable_if_t<!std::is_same< T, U >::value, ebml_shared_ptr< T > & > operator=(const ebml_shared_ptr< U > &other)
Definition: ptrs.h:334
wptr< ebmlElement > ebmlElement_wp
Definition: ptrs.h:886
std::enable_if_t<!std::is_same< T, U >::value, ebml_shared_ptr< U > > c_lock() const
Definition: ptrs.h:645
long long strongcount
Definition: ptrs.h:21
ebml_shared_ptr< T > ebml_const_pointer_cast(const ebml_shared_ptr< U > &)
Definition: ptrs.h:777
ptr< ebmlList > ebmlList_sp
Definition: ptrs.h:862
bool operator==(const ebml_shared_ptr< T > &other) const
Definition: ptrs.h:320
ebml_weak_ptr(control_block *ctl, T *ptr)
Definition: ptrs.h:494
ebml_shared_ptr(const ebml_shared_ptr< T > &other)
Definition: ptrs.h:192