List of all members | Public Types | Public Member Functions | Static Public Member Functions
casadi::Resource Class Reference

RAII class for reading from a zip file. More...

#include <resource.hpp>

Detailed Description

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

Definition at line 42 of file resource.hpp.

Inheritance diagram for casadi::Resource:
Inheritance graph
[legend]

Public Types

using internal_base_type = SharedObjectInternal
 
using base_type = SharedObject
 

Public Member Functions

 Resource (const std::string &path)
 Initialize with a path. More...
 
 Resource ()
 Default constructor. More...
 
const std::string & path () const
 Get path for a consumer. More...
 
void serialize (SerializingStream &s) const
 Serialize an object. More...
 
void change_option (const std::string &option_name, const GenericType &option_value)
 Change option after object creation for debugging. More...
 
std::string class_name () const
 Get class name. More...
 
void disp (std::ostream &stream, bool more=false) const
 Print a description of the object. More...
 
std::string get_str (bool more=false) const
 Get string representation. More...
 
std::string debug_repr () const
 
bool is_null () const
 Is a null pointer? More...
 
casadi_int __hash__ () const
 Returns a number that is unique for a given Node. More...
 

Static Public Member Functions

static std::string type_name ()
 Readable name of the public class. More...
 
static bool test_cast (const SharedObjectInternal *ptr)
 Check if a particular cast is allowed. More...
 
static Resource deserialize (DeserializingStream &s)
 Deserialize with type disambiguation. More...
 

Member Typedef Documentation

◆ base_type

Definition at line 103 of file shared_object.hpp.

◆ internal_base_type

using casadi::SharedObject::internal_base_type = SharedObjectInternal
inherited

Definition at line 102 of file shared_object.hpp.

Constructor & Destructor Documentation

◆ Resource() [1/2]

casadi::Resource::Resource ( const std::string &  path)

If the path is a directory or empty, the path is passed through to the consumer. Otherwise, the zip file is extracted to a temporary directory.

Upon destruction, the temporary directory is removed.

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

◆ Resource() [2/2]

casadi::Resource::Resource ( )
explicit

Member Function Documentation

◆ __hash__()

casadi_int casadi::GenericShared< SharedObject , SharedObjectInternal >::__hash__
inherited

If the Object does not point to any node, "0" is returned.

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

Definition at line 124 of file generic_shared_impl.hpp.

◆ change_option()

void casadi::Resource::change_option ( const std::string &  option_name,
const GenericType option_value 
)

This is only possible for a selected number of options that do not change the numerical results of the comput

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

◆ class_name()

std::string casadi::SharedObject::class_name ( ) const
inherited

◆ debug_repr()

std::string casadi::GenericShared< SharedObject , SharedObjectInternal >::debug_repr
inherited

Definition at line 113 of file generic_shared_impl.hpp.

◆ deserialize()

static Resource casadi::Resource::deserialize ( DeserializingStream s)
static

◆ disp()

void casadi::SharedObject::disp ( std::ostream &  stream,
bool  more = false 
) const
inherited

◆ get_str()

std::string casadi::SharedObject::get_str ( bool  more = false) const
inlineinherited

Definition at line 91 of file shared_object.hpp.

◆ is_null()

bool casadi::GenericShared< SharedObject , SharedObjectInternal >::is_null
inherited

Definition at line 117 of file generic_shared_impl.hpp.

◆ path()

const std::string& casadi::Resource::path ( ) const

◆ serialize()

void casadi::Resource::serialize ( SerializingStream s) const

◆ test_cast()

static bool casadi::Resource::test_cast ( const SharedObjectInternal *  ptr)
static

◆ type_name()

static std::string casadi::Resource::type_name ( )
inlinestatic

Definition at line 59 of file resource.hpp.


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