Name

SPVM::Sys::Poll::PollfdArray - Array of struct pollfd in C language

Usage

use Sys::Poll::PollfdArray;

my $pollfds = Sys::Poll::PollfdArray->new(1024);

Description

Sys::Poll::PollfdArray is the class for the array of struct pollfd in C language.

This is a pointer class.

Class Methods

new

static method new : Sys::Poll::PollfdArray ($length : int);

Create a new Sys::Poll::PollfdArray object with the length.

Instance Methods

DESTROY

method DESTROY : void ();

The destructor.

length

method length : int ();

Get the lenght of the array.

fd

method fd : int ($index : int);

Get fd of the position specifed by the index.

The index must be greater than or equal to 0. Otherwise an exception will be thrown.

The index must be less than the length of the file descripters. Otherwise an exception will be thrown.

set_fd

method set_fd : void ($index : int, $fd : int);

Set fd of the position specifed by the index.

The index must be greater than or equal to 0. Otherwise an exception will be thrown.

The index must be less than the length of the file descripters. Otherwise an exception will be thrown.

events

method events : short ($index : int);

Get events of the position specifed by the index.

The index must be greater than or equal to 0. Otherwise an exception will be thrown.

The index must be less than the length of the file descripters. Otherwise an exception will be thrown.

See Sys::Poll::PollfdArray about the constant values of events.

set_events

method set_events : void ($index : int, $events : short);

Set events of the position specifed by the index.

The index must be greater than or equal to 0. Otherwise an exception will be thrown.

The index must be less than the length of the file descripters. Otherwise an exception will be thrown.

See Sys::Poll::PollfdArray about the constant values of events.

events

method revents : short ($index : short);

Get revents of the position specifed by the index.

The index must be greater than or equal to 0. Otherwise an exception will be thrown.

The index must be less than the length of the file descripters. Otherwise an exception will be thrown.

See Sys::Poll::PollfdArray about the constant values of events.

set_revents

method set_revents : void ($index : int, $revents : short);

Set revents of the position specifed by the index.

The index must be greater than or equal to 0. Otherwise an exception will be thrown.

The index must be less than the length of the file descripters. Otherwise an exception will be thrown.

See Sys::Poll::PollfdArray about the constant values of events.

Copyright & License

Copyright 2022-2022 Yuki Kimoto, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.