Class: Peepmem::Handle

Inherits:
Object
  • Object
show all
Defined in:
ext/peepmem/peepmem.c

Instance Method Summary collapse

Instance Method Details

#[](integer) ⇒ Peepmem::Pointer

Returns:



206
207
208
209
210
211
212
213
# File 'ext/peepmem/peepmem.c', line 206

static VALUE peepmem_handle_aref(VALUE self, VALUE pointer)
{
    VALUE argv[2];

    argv[0] = self;
    argv[1] = pointer;
    return rb_class_new_instance(2, argv, cPointer);
}

#bufferingBoolean

Returns:

  • (Boolean)

See Also:



221
222
223
224
225
226
227
228
229
230
# File 'ext/peepmem/peepmem.c', line 221

static VALUE peepmem_handle_get_buffering(VALUE self)
{
    peepmem_handle_t *hndl = DATA_PTR(self);

    if (hndl->read_mem == read_mem_buffering) {
        return Qtrue;
    } else {
        return Qfalse;
    }
}

#buffering=(Boolean) ⇒ Object



237
238
239
240
241
242
243
244
245
246
247
248
# File 'ext/peepmem/peepmem.c', line 237

static VALUE peepmem_handle_set_buffering(VALUE self, VALUE bool_val)
{
    peepmem_handle_t *hndl = DATA_PTR(self);

    if (RTEST(bool_val)) {
        hndl->read_mem = read_mem_buffering;
        hndl->len = 0;
    } else {
        hndl->read_mem = read_mem_no_buffering;
    }
    return bool_val;
}

#closeObject



268
269
270
271
272
273
274
# File 'ext/peepmem/peepmem.c', line 268

static VALUE peepmem_handle_close(VALUE self)
{
    peepmem_handle_t *hndl = DATA_PTR(self);

    peepmem_handle_free(hndl);
    return Qnil;
}

#process_idInteger

Returns:

  • (Integer)


195
196
197
198
199
# File 'ext/peepmem/peepmem.c', line 195

static VALUE peepmem_handle_get_process_id(VALUE self)
{
    peepmem_handle_t *hndl = DATA_PTR(self);
    return LONG2FIX(hndl->pid);
}