List of all members | Public Types | Public Member Functions | Protected Member Functions
casadi::GenericTypeBase Class Referenceabstract

#include <generic_type_internal.hpp>

Detailed Description

Definition at line 38 of file generic_type_internal.hpp.

Inheritance diagram for casadi::GenericTypeBase:
Inheritance graph
[legend]
Collaboration diagram for casadi::GenericTypeBase:
Collaboration graph
[legend]

Public Types

using weak_ref_type = WeakRefInternal
 

Public Member Functions

virtual ~GenericTypeBase ()
 
virtual TypeID getType () const =0
 
virtual void serialize (SerializingStream &s) const =0
 
virtual std::string class_name () const =0
 Readable name of the internal class. More...
 
virtual void disp (std::ostream &stream, bool more) const =0
 Print a description of the object. More...
 
casadi_int getCount () const
 Get the reference count. More...
 
std::string debug_repr (const SharedObjectInternal *) const
 
GenericWeakRef< SharedObject, SharedObjectInternal > * weak ()
 Get a weak reference to the object. More...
 

Protected Member Functions

void initSingleton ()
 
void destroySingleton ()
 
shared_from_this ()
 Get a shared object from the current internal object. More...
 
const B shared_from_this () const
 Get a shared object from the current internal object. More...
 

Member Typedef Documentation

◆ weak_ref_type

Definition at line 152 of file shared_object.hpp.

Constructor & Destructor Documentation

◆ ~GenericTypeBase()

virtual casadi::GenericTypeBase::~GenericTypeBase ( )
inlinevirtual

Definition at line 40 of file generic_type_internal.hpp.

40 {}

Member Function Documentation

◆ class_name()

virtual std::string casadi::SharedObjectInternal::class_name ( ) const
pure virtualinherited

Implemented in casadi::SymbolicQr, casadi::Sqpmethod, casadi::ShellCompiler, casadi::Scpgen, casadi::RungeKutta, casadi::Qrsqp, casadi::Qrqp, casadi::QpToNlp, casadi::Newton, casadi::Lsqr, casadi::LinsolTridiag, casadi::LinsolQr, casadi::LinsolLdl, casadi::LinearInterpolantJac, casadi::LinearInterpolant, casadi::Ipqp, casadi::ImplicitToNlp, casadi::Feasiblesqpmethod, casadi::FastNewton, casadi::Collocation, casadi::BSplineInterpolant, casadi::WorhpInterface, casadi::TinyXmlInterface, casadi::SuperscsInterface, casadi::KinsolInterface, casadi::IdasInterface, casadi::CvodesInterface, casadi::SqicInterface, casadi::SnoptInterface, casadi::SlicotExpm, casadi::SlicotDple, casadi::SLEQPInterface, casadi::QpoasesInterface, casadi::ProxqpInterface, casadi::OsqpInterface, casadi::OoqpInterface, casadi::MumpsInterface, casadi::MadnlpInterface, casadi::LapackQr, casadi::LapackLu, casadi::KnitroInterface, casadi::IpoptInterface, casadi::Ma27Interface, casadi::HpmpcInterface, casadi::HpipmInterface, casadi::HighsInterface, casadi::GurobiInterface, casadi::FatropInterface, casadi::FatropConicInterface, casadi::DaqpInterface, casadi::CsparseInterface, casadi::CSparseCholeskyInterface, casadi::CplexInterface, casadi::ClpInterface, casadi::ClarabelInterface, casadi::ClangCompiler, casadi::CbcInterface, casadi::BonminInterface, casadi::Blocksqp, casadi::AmplInterface, casadi::AlpaqaInterface, casadi::SXFunction, casadi::Switch, casadi::SparsityInternal, casadi::WeakRefInternal, casadi::ZipMemResource, casadi::ZipResource, casadi::DirResource, casadi::OptiNode, casadi::Nlpsol, casadi::MXNode, casadi::MXFunction, casadi::MapSum, casadi::ThreadMap, casadi::OmpMap, casadi::Map, casadi::JitFunction, casadi::Interpolant, casadi::DllLibrary, casadi::ImporterInternal, casadi::GenericTypeInternal< ID, T >, casadi::FmuFunction, casadi::Fmu3, casadi::Fmu2, casadi::Smoothing, casadi::CentralDiff, casadi::BackwardDiff, casadi::ForwardDiff, casadi::External, casadi::DaeBuilderInternal, casadi::CallbackInternal, and casadi::BlazingSplineFunction.

Referenced by casadi::FunctionInternal::call_forward(), casadi::FunctionInternal::call_reverse(), casadi::FunctionInternal::codegen_body(), casadi::ProtoFunction::construct(), casadi::FmuInternal::deserialize(), casadi::ResourceInternal::deserialize(), casadi::FmuInternal::disp(), casadi::FunctionInternal::disp(), casadi::LinsolInternal::disp(), casadi::XmlFileInternal::dump(), casadi::FunctionInternal::eval(), casadi::FunctionInternal::eval_dm(), casadi::FunctionInternal::eval_sx(), casadi::FunctionInternal::export_code(), casadi::LinsolInternal::generate(), casadi::FunctionInternal::generate_dependencies(), casadi::Conic::generateNativeCode(), casadi::FmuInternal::get_adjoint_derivative(), casadi::FunctionInternal::get_forward(), casadi::FunctionInternal::get_function(), casadi::FunctionInternal::get_jacobian(), casadi::FunctionInternal::get_reverse(), casadi::FiniteDiff::init(), casadi::FunctionInternal::instruction_constant(), casadi::FunctionInternal::instruction_id(), casadi::FunctionInternal::instruction_input(), casadi::FunctionInternal::instruction_MX(), casadi::FunctionInternal::instruction_output(), casadi::FunctionInternal::instructions_sx(), casadi::LinsolInternal::linsol_eval_sx(), casadi::FunctionInternal::n_instructions(), casadi::FunctionInternal::n_nodes(), casadi::LinsolInternal::neig(), casadi::LinsolInternal::nfact(), casadi::FunctionInternal::oracle(), casadi::XmlFileInternal::parse(), casadi::LinsolInternal::rank(), casadi::FmuInternal::serialize_type(), casadi::ResourceInternal::serialize_type(), and casadi::LinsolInternal::solve().

◆ debug_repr()

std::string casadi::GenericSharedInternal< SharedObject , SharedObjectInternal >::debug_repr ( const Internal *  i) const
inherited

Definition at line 62 of file generic_shared_internal.hpp.

162  {
163  // Note: i != this because of something something multiple inheritance
164  return str( (casadi_int)(i)) + "/" + static_cast<const Internal*>(this)->class_name();
165  }
std::string str(const T &v)
String representation, any type.

◆ destroySingleton()

void casadi::GenericSharedInternal< SharedObject , SharedObjectInternal >::destroySingleton ( )
inlineprotectedinherited

Called in the destructor of singletons

Definition at line 77 of file generic_shared_internal.hpp.

77  {
78  static_cast<Internal*>(this)->count--;
79  }

◆ disp()

virtual void casadi::SharedObjectInternal::disp ( std::ostream &  stream,
bool  more 
) const
pure virtualinherited

◆ getCount()

Definition at line 60 of file generic_shared_internal.hpp.

186  {
187  return static_cast<const Internal*>(this)->count;
188  }

◆ getType()

virtual TypeID casadi::GenericTypeBase::getType ( ) const
pure virtual

◆ initSingleton()

void casadi::GenericSharedInternal< SharedObject , SharedObjectInternal >::initSingleton ( )
inlineprotectedinherited

Called in the constructor of singletons to avoid that the counter reaches zero

Definition at line 71 of file generic_shared_internal.hpp.

71  {
72  casadi_assert_dev(static_cast<Internal*>(this)->count==0);
73  static_cast<Internal*>(this)->count++;
74  }

◆ serialize()

virtual void casadi::GenericTypeBase::serialize ( SerializingStream s) const
pure virtual

◆ shared_from_this() [1/2]

B casadi::GenericSharedInternal< SharedObject , SharedObjectInternal >::shared_from_this ( )
inlineprotectedinherited

Definition at line 83 of file generic_shared_internal.hpp.

83  {
84  casadi_assert_dev(B::test_cast(static_cast<Internal*>(this)));
85  B ret;
86  ret.own(static_cast<Internal*>(this));
87  return ret;
88  }

◆ shared_from_this() [2/2]

const B casadi::GenericSharedInternal< SharedObject , SharedObjectInternal >::shared_from_this ( ) const
inlineprotectedinherited

Definition at line 92 of file generic_shared_internal.hpp.

92  {
93  casadi_assert_dev(B::test_cast(static_cast<const Internal*>(this)));
94  B ret;
95  ret.own(const_cast<Internal*>(static_cast<const Internal*>(this)));
96  return ret;
97  }

◆ weak()

Extra doc: https://github.com/casadi/casadi/wiki/L_1ai

Definition at line 67 of file generic_shared_internal.hpp.

191  {
192  if (weak_ref_==nullptr) {
193  weak_ref_ = new GenericWeakRef<Shared, Internal>(static_cast<Internal*>(this));
194  }
195  return weak_ref_;
196  }

The documentation for this class was generated from the following file: