line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Wx::Perl::Thread::ClassPublisher; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
657
|
use Wx; # before 'use base' |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use strict; |
6
|
|
|
|
|
|
|
use warnings; |
7
|
|
|
|
|
|
|
use base qw(Wx::Perl::Thread::Listener Class::Publisher); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Storable; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub _notify_subscribers { |
12
|
|
|
|
|
|
|
my( $self, $data ) = @_; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
$self->notify_subscribers( @{Storable::thaw( $data )} ); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub notify_subscribers { |
18
|
|
|
|
|
|
|
my( $self, @data ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
if( Wx::Thread::IsMain() ) { |
21
|
|
|
|
|
|
|
$self->SUPER::notify_subscribers( @data ); |
22
|
|
|
|
|
|
|
} else { |
23
|
|
|
|
|
|
|
$self->_send_event( Storable::freeze( \@data ) ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |