AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/swig4.0/ruby/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /usr/share/swig4.0/ruby/std_shared_ptr.i
#define SWIG_SHARED_PTR_NAMESPACE std
%include <boost_shared_ptr.i>
%include <rubystdcommon_forward.swg>


%fragment("StdSharedPtrTraits","header",fragment="StdTraitsForwardDeclaration",fragment="<memory>")
{
namespace swig {
  /*
   Template specialization for functions defined in rubystdcommon.swg. Special handling for shared_ptr
   is required as, shared_ptr<T> * is used rather than the usual T *, see shared_ptr.i.
  */
  template <class Type>
  struct traits_asptr<std::shared_ptr<Type> > {
    static int asptr(VALUE obj, std::shared_ptr<Type> **val) {
      std::shared_ptr<Type> *p = 0;
      swig_type_info *descriptor = type_info<std::shared_ptr<Type> >();
      swig_ruby_owntype newmem = {0, 0};
      int res = descriptor ? SWIG_ConvertPtrAndOwn(obj, (void **)&p, descriptor, 0, &newmem) : SWIG_ERROR;
      if (SWIG_IsOK(res)) {
	if (val) {
	  if (*val) {
	    **val = p ? *p : std::shared_ptr<Type>();
	  } else {
	    *val = p;
	    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
	      // Upcast for pointers to shared_ptr in this generic framework has not been implemented
	      res = SWIG_ERROR;
	    }
	  }
	}
	if (newmem.own & SWIG_CAST_NEW_MEMORY)
	  delete p;
      }
      return res;
    }
  };

  template <class Type>
  struct traits_asval<std::shared_ptr<Type> > {
    static int asval(VALUE obj, std::shared_ptr<Type> *val) {
      if (val) {
	std::shared_ptr<Type> ret;
	std::shared_ptr<Type> *p = &ret;
	int res = traits_asptr<std::shared_ptr<Type> >::asptr(obj, &p);
	if (!SWIG_IsOK(res))
	  return res;
	*val = ret;
	return SWIG_OK;
      } else {
	return traits_asptr<std::shared_ptr<Type> >::asptr(obj, (std::shared_ptr<Type> **)(0));
      }
    }
  };

  template <class Type>
    struct traits_asval<std::shared_ptr<Type> *> {
    static int asval(VALUE obj, std::shared_ptr<Type> **val) {
      if (val) {
	typedef typename noconst_traits<std::shared_ptr<Type> >::noconst_type noconst_type;
	if (*val) {
	  noconst_type ret;
	  noconst_type *p = &ret;
	  int res = traits_asptr<noconst_type>::asptr(obj, &p);
	  if (SWIG_IsOK(res))
	    **(const_cast<noconst_type**>(val)) = ret;
	  return res;
	} else {
	  noconst_type *p = 0;
	  int res = traits_asptr<noconst_type>::asptr(obj,  &p);
	  if (SWIG_IsOK(res))
	    *val = p;
	  return res;
	}
      } else {
	return traits_asptr<std::shared_ptr<Type> >::asptr(obj, (std::shared_ptr<Type> **)(0));
      }
    }
  };

  template <class Type>
  struct traits_as<std::shared_ptr<Type>, pointer_category> {
    static std::shared_ptr<Type> as(VALUE obj) {
      std::shared_ptr<Type> ret;
      std::shared_ptr<Type> *v = &ret;
      int res = traits_asptr<std::shared_ptr<Type> >::asptr(obj, &v);
      if (SWIG_IsOK(res)) {
	return ret;
      } else {
	
	VALUE lastErr = rb_gv_get("$!");
	if (lastErr == Qnil)
	  SWIG_Error(SWIG_TypeError,  swig::type_name<std::shared_ptr<Type> >());
        throw std::invalid_argument("bad type");
      }
    }
  };

  template <class Type>
  struct traits_as<std::shared_ptr<Type> *, pointer_category> {
    static std::shared_ptr<Type> * as(VALUE obj) {
      std::shared_ptr<Type> *p = 0;
      int res = traits_asptr<std::shared_ptr<Type> >::asptr(obj, &p);
      if (SWIG_IsOK(res)) {
	return p;
      } else {
	
	VALUE lastErr = rb_gv_get("$!");
	if (lastErr == Qnil)
	  SWIG_Error(SWIG_TypeError,  swig::type_name<std::shared_ptr<Type> *>());
        throw std::invalid_argument("bad type");
      }
    }
  };

  template <class Type>
  struct traits_from_ptr<std::shared_ptr<Type> > {
    static VALUE from(std::shared_ptr<Type> *val, int owner = 0) {
      if (val && *val) {
        return SWIG_NewPointerObj(val, type_info<std::shared_ptr<Type> >(), owner);
      } else {
        return Qnil;
      }
    }
  };

  /*
   The descriptors in the shared_ptr typemaps remove the const qualifier for the SWIG type system.
   Remove const likewise here, otherwise SWIG_TypeQuery("std::shared_ptr<const Type>") will return NULL.
  */
  template<class Type>
  struct traits_from<std::shared_ptr<const Type> > {
    static VALUE from(const std::shared_ptr<const Type>& val) {
      std::shared_ptr<Type> p = std::const_pointer_cast<Type>(val);
      return swig::from(p);
    }
  };
}
}

%fragment("StdSharedPtrTraits");

Anon7 - 2022
AnonSec Team