Sha256: df9dc69c8b24e579c262f1e2d94a77f7f2a55929c9c86896715e09ad83b9950a

Contents?: true

Size: 975 Bytes

Versions: 28

Compression:

Stored size: 975 Bytes

Contents

#ifndef Rice__Builtin_Object__ipp_
#define Rice__Builtin_Object__ipp_

#include "Object.hpp"
#include "protect.hpp"
#include "detail/check_ruby_type.hpp"

#include <algorithm>

namespace Rice
{

namespace detail
{
  inline VALUE check_type(Object value, int type)
  {
    rb_check_type(value, type);
    return Qnil;
  }
}

template<typename T, int Builtin_Type>
inline Builtin_Object<T, Builtin_Type>::
Builtin_Object(Object value)
  : Object(value)
  , obj_((T*)(value.value()))
{
  protect(detail::check_type, value, Builtin_Type);
}

template<typename T, int Builtin_Type>
inline Builtin_Object<T, Builtin_Type>::
Builtin_Object(Builtin_Object<T, Builtin_Type> const & other)
  : Object(other.value())
  , obj_(other.obj_)
{
}

template<typename T, int Builtin_Type>
inline void Builtin_Object<T, Builtin_Type>::
swap(Builtin_Object<T, Builtin_Type> & ref)
{
  std::swap(obj_, ref.obj_);
  Object::swap(ref);
}

} // namespace Rice

#endif // Rice__Builtin_Object__ipp_

Version data entries

28 entries across 28 versions & 5 rubygems

Version Path
rice-1.6.3 rice/Builtin_Object.ipp
jameskilton-rice-1.2.0 rice/Builtin_Object.ipp
rice-1.6.2 rice/Builtin_Object.ipp
rice-1.6.1 rice/Builtin_Object.ipp
rice-1.6.0 rice/Builtin_Object.ipp
rice-1.6.0.pre rice/Builtin_Object.ipp
rice-1.5.3 rice/Builtin_Object.ipp
rice-1.5.2 rice/Builtin_Object.ipp
keyme-rice-1.5.1.keyme1 rice/Builtin_Object.ipp
keyme-rice-1.5.1.keyme rice/Builtin_Object.ipp
rice-1.5.1 rice/Builtin_Object.ipp
rice-1.5.0 rice/Builtin_Object.ipp
rice-jdguyot-1.4.3p1 rice/Builtin_Object.ipp
rice-1.4.3 rice/Builtin_Object.ipp
wurlinc-rice-1.4.0.4 rice/Builtin_Object.ipp
wurlinc-rice-1.4.0.1 rice/Builtin_Object.ipp
rice-1.4.2 rice/Builtin_Object.ipp
rice-jdguyot-1.4.0.p1 rice/Builtin_Object.ipp
rice-jdguyot-1.4.0 rice/Builtin_Object.ipp
rice-1.4.0 rice/Builtin_Object.ipp