1 #ifndef __FACE_SDK__PBIO__OBJECT_WITH_REF_COUNTER_H__2a81343862d047159b41d58bfe5e730b
2 #define __FACE_SDK__PBIO__OBJECT_WITH_REF_COUNTER_H__2a81343862d047159b41d58bfe5e730b
4 #include "atomic_exchange_add.h"
12 class object_with_ref_counter
18 #ifdef __FACE_SDK_PBIO_LIGHT_SHARED_PTR_NEED_REFCOUNTER__d213e87df35b4d47af0999a1192bce7d
20 int32_t refcounter_field;
25 return refcounter_field;
32 return object.refcounter4light_shared_ptr;
38 void increment_refcounter()
40 atomic_exchange_add(refcounter(), 1);
43 void decrement_refcounter()
45 if(atomic_exchange_add(refcounter(), -1) == 1)
52 object_with_ref_counter():
53 object() { refcounter() = 0; }
56 object_with_ref_counter(t1 a1):
57 object(a1) { refcounter() = 0; }
60 template<
typename t2,
typename t1>
61 object_with_ref_counter(t2 a2, t1 a1):
62 object(a2, a1) { refcounter() = 0; }
65 template<
typename t3,
typename t2,
typename t1>
66 object_with_ref_counter(t3 a3, t2 a2, t1 a1):
67 object(a3, a2, a1) { refcounter() = 0; }
69 template<
typename t4,
typename t3,
typename t2,
typename t1>
70 object_with_ref_counter(t4 a4, t3 a3, t2 a2, t1 a1):
71 object(a4, a3, a2, a1) { refcounter() = 0; }
74 template<
typename t5,
typename t4,
typename t3,
typename t2,
typename t1>
75 object_with_ref_counter(t5 a5, t4 a4, t3 a3, t2 a2, t1 a1):
76 object(a5, a4, a3, a2, a1) { refcounter() = 0; }
78 template<
typename t6,
typename t5,
typename t4,
typename t3,
typename t2,
typename t1>
79 object_with_ref_counter(t6 a6, t5 a5, t4 a4, t3 a3, t2 a2, t1 a1):
80 object(a6, a5, a4, a3, a2, a1) { refcounter() = 0; }
83 template<
typename t7,
typename t6,
typename t5,
typename t4,
typename t3,
typename t2,
typename t1>
84 object_with_ref_counter(t7 a7, t6 a6, t5 a5, t4 a4, t3 a3, t2 a2, t1 a1):
85 object(a7, a6, a5, a4, a3, a2, a1) { refcounter() = 0; }
87 template<
typename t8,
typename t7,
typename t6,
typename t5,
typename t4,
typename t3,
typename t2,
typename t1>
88 object_with_ref_counter(t8 a8, t7 a7, t6 a6, t5 a5, t4 a4, t3 a3, t2 a2, t1 a1):
89 object(a8, a7, a6, a5, a4, a3, a2, a1) { refcounter() = 0; }
92 template<
typename t9,
typename t8,
typename t7,
typename t6,
typename t5,
typename t4,
typename t3,
typename t2,
typename t1>
93 object_with_ref_counter(t9 a9, t8 a8, t7 a7, t6 a6, t5 a5, t4 a4, t3 a3, t2 a2, t1 a1):
94 object(a9, a8, a7, a6, a5, a4, a3, a2, a1) { refcounter() = 0; }
97 template<
typename t10,
typename t9,
typename t8,
typename t7,
typename t6,
typename t5,
typename t4,
typename t3,
typename t2,
typename t1>
98 object_with_ref_counter(t10 a10, t9 a9, t8 a8, t7 a7, t6 a6, t5 a5, t4 a4, t3 a3, t2 a2, t1 a1):
99 object(a10, a9, a8, a7, a6, a5, a4, a3, a2, a1) { refcounter() = 0; }
102 template<
typename t11,
typename t10,
typename t9,
typename t8,
typename t7,
typename t6,
typename t5,
typename t4,
typename t3,
typename t2,
typename t1>
103 object_with_ref_counter(t11 a11, t10 a10, t9 a9, t8 a8, t7 a7, t6 a6, t5 a5, t4 a4, t3 a3, t2 a2, t1 a1):
104 object(a11, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1) { refcounter() = 0; }
106 template<
typename t12,
typename t11,
typename t10,
typename t9,
typename t8,
typename t7,
typename t6,
typename t5,
typename t4,
typename t3,
typename t2,
typename t1>
107 object_with_ref_counter(t12 a12, t11 a11, t10 a10, t9 a9, t8 a8, t7 a7, t6 a6, t5 a5, t4 a4, t3 a3, t2 a2, t1 a1):
108 object(a12, a11, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1) { refcounter() = 0; }
116 #endif // __FACE_SDK__PBIO__OBJECT_WITH_REF_COUNTER_H__2a81343862d047159b41d58bfe5e730b