Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/self/root/proc/thread-self/root/proc/self/root/usr/share/perl5/vendor_perl/X10/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/thread-self/root/proc/self/root/usr/share/perl5/vendor_perl/X10/Macro.pm
# Copyright (c) 1999-2017 Rob Fugina <robf@fugina.com>
# Distributed under the terms of the GNU Public License, Version 3.0

package X10::Macro;

use strict;

use X10::Event;


sub new
{
   my $type = shift;

   my $self = bless { @_ }, $type;

   return $self;
}


sub run
{
   my $self = shift;

   return undef unless $self->{controller};

   # send a list of events (specified by string)
   if (exists $self->{events})
   {
      $self->{controller}->send(
	map { new X10::Event($_) } @{$self->{events}}
	);
   }
   # send a list of events returned by a perl sub
   elsif (exists $self->{perleval})
   {
      $self->{controller}->send($self->{perleval}->());
   }
   # run a perl sub
   elsif (exists $self->{perlsub})
   {
      $self->{perlsub}->();
   }
   else
   {
      return undef;
   }

   return 1;
}

sub controller
{
   my $self = shift;

   if (@_)
   {
      $self->{controller} = shift;
   }

   return $self->{controller};
}

sub description
{
   my $self = shift;
   return $self->{description};
}



1;


Hry