| 1 | package MouseX::POE::Meta::Trait::Object; | ||||||||||||
| 2 | 12 | $MouseX::POE::Meta::Trait::Object::VERSION = '0.216'; | |||||||||||
| 3 | # ABSTRACT: The base class role for MouseX::POE | ||||||||||||
| 4 | |||||||||||||
| 5 | 12 | ▶ | use Mouse::Role; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 12 | ▶ | use POE::Session; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 12 | ▶ | use Mouse::Util; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 44 | ▶ | sub BUILD { | ||||||||||
|
Subroutine
BUILD: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||
| 10 | 44 | my $self = shift; | |||||||||||
| 11 | |||||||||||||
| 12 | my $session = POE::Session->create( | ||||||||||||
| 13 | inline_states => | ||||||||||||
| 14 | 44 | ▶ | { _start => sub { POE::Kernel->yield('STARTALL', \$_[5] ) }, }, | ||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||
| 15 | object_states => [ | ||||||||||||
| 16 | $self => { | ||||||||||||
| 17 | $self->meta->get_all_events, | ||||||||||||
| 18 | STARTALL => 'STARTALL', | ||||||||||||
| 19 | _stop => 'STOPALL', | ||||||||||||
| 20 | _child => 'CHILD', | ||||||||||||
| 21 | _parent => 'PARENT', | ||||||||||||
| 22 | _call_kernel_with_my_session => '_call_kernel_with_my_session', | ||||||||||||
| 23 | }, | ||||||||||||
| 24 | ], | ||||||||||||
| 25 | args => [$self], | ||||||||||||
| 26 | 44 | ▶ | heap => ( $self->{heap} ||= {} ), | ||||||||||
|
Condition50%1/2
$self->{"heap"} ||= {}
MC/DC0%0/1
$self->{"heap"} ||= {}
$self->{"heap"}
Truth table50%1/2
A
A= $self->{"heap"}
| |||||||||||||
| 27 | ); | ||||||||||||
| 28 | 44 | $self->{session_id} = $session->ID; | |||||||||||
| 29 | } | ||||||||||||
| 30 | |||||||||||||
| 31 | 80 | ▶ | sub get_session_id { | ||||||||||
|
Subroutine
get_session_id: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 32 | 80 | my ($self) = @_; | |||||||||||
| 33 | 80 | return $self->{session_id}; | |||||||||||
| 34 | #return $self->meta->get_meta_instance->get_session_id($self); | ||||||||||||
| 35 | } | ||||||||||||
| 36 | |||||||||||||
| 37 | 77 | ▶ | sub yield { my $self = shift; POE::Kernel->post( $self->get_session_id, @_ ) } | ||||||||||
|
Subroutine
yield: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 38 | |||||||||||||
| 39 | 3 | ▶ | sub call { my $self = shift; POE::Kernel->call( $self->get_session_id, @_ ) } | ||||||||||
|
Subroutine
call: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 40 | |||||||||||||
| 41 | 3 | ▶ | sub _call_kernel_with_my_session { | ||||||||||
|
Subroutine
_call_kernel_with_my_session: called CC=1 SCAR=0.0
| |||||||||||||
| 42 | 3 | my ( $self, $function, @args ) = @_[ OBJECT, ARG0..$#_ ]; | |||||||||||
| 43 | 3 | POE::Kernel->$function( @args ); | |||||||||||
| 44 | } | ||||||||||||
| 45 | |||||||||||||
| 46 | 3 | ▶ | sub delay { my $self = shift; $self->call( _call_kernel_with_my_session => 'delay' => @_ ) } | ||||||||||
|
Subroutine
delay: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 47 | 0 | ▶ | sub alarm { my $self = shift; $self->call( _call_kernel_with_my_session => 'alarm', @_ ) } | ||||||||||
|
Subroutine
alarm: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 48 | 0 | ▶ | sub alarm_add { my $self = shift; $self->call( _call_kernel_with_my_session => 'alarm_add', @_ ) } | ||||||||||
|
Subroutine
alarm_add: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 49 | 0 | ▶ | sub delay_add { my $self = shift; $self->call( _call_kernel_with_my_session => 'delay_add', @_ ) } | ||||||||||
|
Subroutine
delay_add: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 50 | 0 | ▶ | sub alarm_set { my $self = shift; $self->call( _call_kernel_with_my_session => 'alarm_set', @_ ) } | ||||||||||
|
Subroutine
alarm_set: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 51 | 0 | ▶ | sub alarm_adjust { my $self = shift; $self->call( _call_kernel_with_my_session => 'alarm_adjust', @_ ) } | ||||||||||
|
Subroutine
alarm_adjust: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 52 | 0 | ▶ | sub alarm_remove { my $self = shift; $self->call( _call_kernel_with_my_session => 'alarm_remove', @_ ) } | ||||||||||
|
Subroutine
alarm_remove: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 53 | 0 | ▶ | sub alarm_remove_all { my $self = shift; $self->call( _call_kernel_with_my_session => 'alarm_remove_all', @_ ) } | ||||||||||
|
Subroutine
alarm_remove_all: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 54 | 0 | ▶ | sub delay_set { my $self = shift; $self->call( _call_kernel_with_my_session => 'delay_set', @_ ) } | ||||||||||
|
Subroutine
delay_set: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 55 | 0 | ▶ | sub delay_adjust { my $self = shift; $self->call( _call_kernel_with_my_session => 'delay_adjust', @_ ) } | ||||||||||
|
Subroutine
delay_adjust: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 56 | |||||||||||||
| 57 | 44 | ▶ | sub STARTALL { | ||||||||||
|
Subroutine
STARTALL: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||
| 58 | 44 | my ( $self, @params ) = @_; | |||||||||||
| 59 | 44 | $params[4] = pop @params; | |||||||||||
| 60 | 44 | for my $class (reverse $self->meta->linearized_isa) { | |||||||||||
| 61 | 136 | ▶ | my $start = Mouse::Util::get_code_ref($class, 'START') | ||||||||||
|
Condition100%2/2
Mouse::Util::get_code_ref($class, 'START') || (next)
MC/DC100%1/1
Mouse::Util::get_code_ref($class, 'START') || (next)
Mouse::Util::get_code_ref($class, 'START')
Truth table100%2/2
A
A= Mouse::Util::get_code_ref($class, 'START')
| |||||||||||||
| 62 | || next; | ||||||||||||
| 63 | 91 | $start->( $self, @params ); | |||||||||||
| 64 | } | ||||||||||||
| 65 | } | ||||||||||||
| 66 | |||||||||||||
| 67 | 70 | ▶ | sub STOPALL { | ||||||||||
|
Subroutine
STOPALL: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||
| 68 | 70 | my ( $self, $params ) = @_; | |||||||||||
| 69 | 70 | for my $class (reverse $self->meta->linearized_isa) { | |||||||||||
| 70 | 214 | ▶ | my $start = Mouse::Util::get_code_ref($class, 'STOP') | ||||||||||
|
Condition100%2/2
Mouse::Util::get_code_ref($class, 'STOP') || (next)
MC/DC100%1/1
Mouse::Util::get_code_ref($class, 'STOP') || (next)
Mouse::Util::get_code_ref($class, 'STOP')
Truth table100%2/2
A
A= Mouse::Util::get_code_ref($class, 'STOP')
| |||||||||||||
| 71 | || next; | ||||||||||||
| 72 | 133 | $start->( $self, $params ); | |||||||||||
| 73 | } | ||||||||||||
| 74 | } | ||||||||||||
| 75 | |||||||||||||
| 76 | 44 | ▶ | sub START { } | ||||||||||
|
Subroutine
START: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 77 | 70 | ▶ | sub STOP { } | ||||||||||
|
Subroutine
STOP: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 78 | 2 | ▶ | sub CHILD { } | ||||||||||
|
Subroutine
CHILD: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 79 | 0 | ▶ | sub PARENT { } | ||||||||||
|
Subroutine
PARENT: not called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 80 | |||||||||||||
| 81 | # __PACKAGE__->meta->add_method( _stop => sub { POE::Kernel->call('STOP') } ); | ||||||||||||
| 82 | |||||||||||||
| 83 | |||||||||||||
| 84 | 12 | ▶ | no Mouse::Role; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 85 | |||||||||||||
| 86 | 12 | 1; | |||||||||||
| 87 | |||||||||||||
| 88 | __END__ | ||||||||||||