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.
Fields
length
has length : ro int;
The length of the array.
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 : int ($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 : int);
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 : int ($index : int);
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 : int);
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 (c) 2023 Yuki Kimoto
MIT License