public Object clearVariable(RubyBasicObject object, String name) { synchronized(object) { Object value = getVariableAccessorForRead(name).get(object); getVariableAccessorForWrite(name).set(object, null); return value; } }
/** * Retrieve the FFI ext handle for the given object. * * @param self the object * @return the object's FFI handle */ public final Object getFFIHandle(RubyBasicObject self) { return getFFIHandleAccessorForRead().get(self); }
/** * Set the FFI handle for the given object. * * @param self the object * @param self the object's FFI handle */ public final void setFFIHandle(RubyBasicObject self, Object value) { int index = getFFIHandleAccessorForWrite().getIndex(); setVariableInternal(realClass, self, index, value); }
/** * Set the C ext handle for the given object. * * @param self the object * @param value the object's C ext handle */ public final void setNativeHandle(RubyBasicObject self, Object value) { int index = getNativeHandleAccessorForRead().getIndex(); if(index == -1) { return; } setVariableInternal(realClass, self, index, value); }
/** * Retrieve the C ext handle for the given object. * * @param self the object * @return the object's C ext handle */ public final Object getNativeHandle(RubyBasicObject self) { return getNativeHandleAccessorForRead().get(self); }
/** * Retrieve the variable's value from the given object. * * @param object the object from which to retrieve this variable * @return the variable's value */ public Object get(Object object) { return getVariable((RubyBasicObject)object, index); }
/** * Retrieve the variable access for write. * * @param tableMgr the VariableTableManager for which to allocate an * accessor, if it has not already been allocated. * @return the variable accessor appropriate for writes. */ public VariableAccessor getVariableAccessorForWrite(VariableTableManager tableMgr) { return variableAccessor != VariableAccessor.DUMMY_ACCESSOR ? variableAccessor : allocateVariableAccessor(tableMgr); }
/** * Produce a string representation of this VariableAccessor. * * @return a string representation of this VariableAccessor */ @Override public String toString() { return "ivar:" + getName() + ":" + index; }
/** * Retrieve the read accessor for FFI handle. If no object_id has been prepared, this will return a dummy * accessor that just returns null. * * @return the read accessor for FFI handle */ public VariableAccessor getFFIHandleAccessorForRead() { return ffiHandleVariableAccessorField.getVariableAccessorForRead(); }
public Object clearVariable(RubyBasicObject object, String name) { synchronized(object) { Object value = getVariableAccessorForRead(name).get(object); getVariableAccessorForWrite(name).set(object, null); return value; } }
/** * Set the FFI handle for the given object. * * @param self the object * @param self the object's FFI handle */ public final void setFFIHandle(RubyBasicObject self, Object value) { int index = getFFIHandleAccessorForWrite().getIndex(); setVariableInternal(realClass, self, index, value); }
/** * Retrieve the FFI ext handle for the given object. * * @param self the object * @return the object's FFI handle */ public final Object getFFIHandle(RubyBasicObject self) { return getFFIHandleAccessorForRead().get(self); }
/** * Set the C ext handle for the given object. * * @param self the object * @param value the object's C ext handle */ public final void setNativeHandle(RubyBasicObject self, Object value) { int index = getNativeHandleAccessorForRead().getIndex(); if(index == -1) { return; } setVariableInternal(realClass, self, index, value); }
/** * Retrieve the C ext handle for the given object. * * @param self the object * @return the object's C ext handle */ public final Object getNativeHandle(RubyBasicObject self) { return getNativeHandleAccessorForRead().get(self); }
public Object clearVariable(RubyBasicObject object, String name) { synchronized(object) { Object value = getVariableAccessorForRead(name).get(object); getVariableAccessorForWrite(name).set(object, null); return value; } }
/** * Set the FFI handle for the given object. * * @param self the object * @param self the object's FFI handle */ public final void setFFIHandle(RubyBasicObject self, Object value) { int index = getFFIHandleAccessorForWrite().getIndex(); setVariableInternal(realClass, self, index, value); }
/** * Retrieve the FFI ext handle for the given object. * * @param self the object * @return the object's FFI handle */ public final Object getFFIHandle(RubyBasicObject self) { return getFFIHandleAccessorForRead().get(self); }
public Object clearVariable(RubyBasicObject object, String name) { synchronized(object) { Object value = getVariableAccessorForRead(name).get(object); getVariableAccessorForWrite(name).set(object, null); return value; } }
/** * Set the FFI handle for the given object. * * @param self the object * @param self the object's FFI handle */ public final void setFFIHandle(RubyBasicObject self, Object value) { int index = getFFIHandleAccessorForWrite().getIndex(); setVariableInternal(realClass, self, index, value); }
/** * Retrieve the FFI ext handle for the given object. * * @param self the object * @return the object's FFI handle */ public final Object getFFIHandle(RubyBasicObject self) { return getFFIHandleAccessorForRead().get(self); }