X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FBit%2FMorseSignals%2FEmitter.pm;h=441e6e4cc5dd5702f3f4aa4d34c3d5589244578a;hb=8ce9fd9d5f4e6197d1a33a3fd11953cc1dc3b31f;hp=9d0273a34d44197b017b6c55b8139007562654af;hpb=ed888890547450e75030085fadb958c5ea2a6421;p=perl%2Fmodules%2FBit-MorseSignals.git diff --git a/lib/Bit/MorseSignals/Emitter.pm b/lib/Bit/MorseSignals/Emitter.pm index 9d0273a..441e6e4 100644 --- a/lib/Bit/MorseSignals/Emitter.pm +++ b/lib/Bit/MorseSignals/Emitter.pm @@ -15,15 +15,15 @@ Bit::MorseSignals::Emitter - Base class for Bit::MorseSignals emitters. =head1 VERSION -Version 0.02 +Version 0.05 =cut -our $VERSION = '0.02'; +our $VERSION = '0.05'; =head1 SYNOPSIS - use Bit::MorseSignals; + use Bit::MorseSignals::Emitter; my $deuce = new Bit::MorseSignals::Emitter; $deuce->post("hlagh") for 1 .. 3; @@ -81,7 +81,7 @@ sub new { return $self; } -=head2 C<< post $msg, [ type => $type ] >> +=head2 C<< post $msg, < type => $type > >> Adds C<$msg> to the message queue and, if no other message is currently processed, dequeue the oldest item and prepare it. The type is automatically chosen, but you may want to try to force it with the C option : C<$type> is then one of the C constants listed in L @@ -176,6 +176,30 @@ sub pop { return $bit; } +=head2 C + +The length of the currently posted message. + +=cut + +sub len { + my ($self) = @_; + _check_self($self); + return $self->{len}; +} + +=head2 C + +The number of bits that have already been sent for the current message. + +=cut + +sub pos { + my ($self) = @_; + _check_self($self); + return $self->{pos}; +} + =head2 C Cancels the current transfer, but does not empty the queue. @@ -241,7 +265,7 @@ L, L. =head1 AUTHOR -Vincent Pit, C<< >> +Vincent Pit, C<< >>, L. You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).