#include <shared_object.hpp>
Definition at line 164 of file shared_object.hpp.
◆ weak_ref_type
◆ class_name()
| std::string casadi::WeakRefInternal::class_name |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ debug_repr()
Definition at line 62 of file generic_shared_internal.hpp.
177 return str( (casadi_int)(i)) +
"/" +
static_cast<const Internal*
>(
this)->class_name();
std::string str(const T &v)
String representation, any type.
◆ destroySingleton()
◆ disp()
| void casadi::WeakRefInternal::disp |
( |
std::ostream & |
stream, |
|
|
bool |
more |
|
) |
| const |
|
overridevirtual |
◆ getCount()
◆ initSingleton()
Called in the constructor of singletons to avoid that the counter reaches zero
Definition at line 71 of file generic_shared_internal.hpp.
72 casadi_assert_dev(
static_cast<Internal*
>(
this)->count==0);
73 static_cast<Internal*
>(
this)->count++;
◆ shared_from_this() [1/2]
Definition at line 83 of file generic_shared_internal.hpp.
84 casadi_assert_dev(B::test_cast(
static_cast<Internal*
>(
this)));
86 ret.own(
static_cast<Internal*
>(
this));
◆ shared_from_this() [2/2]
Definition at line 92 of file generic_shared_internal.hpp.
93 casadi_assert_dev(B::test_cast(
static_cast<const Internal*
>(
this)));
95 ret.own(
const_cast<Internal*
>(
static_cast<const Internal*
>(
this)));
◆ weak()
Extra doc: https://github.com/casadi/casadi/wiki/L_1ai
Definition at line 67 of file generic_shared_internal.hpp.
211 #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
212 auto* w = weak_ref_.load(std::memory_order_acquire);
214 auto* nw =
new GenericWeakRef<Shared, Internal>(
static_cast<Internal*
>(
this));
215 GenericWeakRef<Shared, Internal>* expected =
nullptr;
216 if (weak_ref_.compare_exchange_strong(
217 expected, nw, std::memory_order_release, std::memory_order_acquire)) {
226 if (weak_ref_==
nullptr) {
227 weak_ref_ =
new GenericWeakRef<Shared, Internal>(
static_cast<Internal*
>(
this));
◆ raw_
The documentation for this class was generated from the following files: