Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.191.104.49
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : EventList.pm

# Copyright (c) 1999-2017 Rob Fugina <robf@fugina.com>
# Distributed under the terms of the GNU Public License, Version 3.0

package X10::EventList;

use vars qw(@ISA);

use Storable;

@ISA = qw(Storable);

use strict;

sub new
{
   my $type = shift;

   my $self = bless { list => [] }, $type;

   foreach (@_)
   {
      if (ref $_ eq 'X10::Event')
      {
         push @{$self->{list}}, $_;
      }
      elsif (ref $_ eq 'X10::EventList')
      {
         push @{$self->{list}}, $_->list;
      }
      elsif (ref $_ eq '')
      {
         push @{$self->{list}}, new X10::Event($_);
      }
      else
      {
         warn "Can't deal with a ", ref $_;
      }
   }

   @{$self->{list}} = grep { $_ } @{$self->{list}};

   return undef unless @{$self->{list}};

   return $self;
}

sub as_string
{
   my $self = shift;

   join(', ', map { $_->as_string } @{$self->{list}});
}

sub list
{
   my $self = shift;
   @{$self->{list}};
}

###

# build a string of words that implement this event
sub compile
{
   my $self = shift;

   map { $_->compile } @{$self->{list}};
}


###


1;

© 2025 GrazzMean