]> git.vpit.fr Git - perl/modules/Bit-MorseSignals.git/blobdiff - lib/Bit/MorseSignals/Emitter.pm
Importing Bit-MorseSignals-0.05.tar.gz
[perl/modules/Bit-MorseSignals.git] / lib / Bit / MorseSignals / Emitter.pm
index 44fec2401627773a9c817e1af2e4dd6e6087c5aa..441e6e4cc5dd5702f3f4aa4d34c3d5589244578a 100644 (file)
@@ -15,15 +15,15 @@ Bit::MorseSignals::Emitter - Base class for Bit::MorseSignals emitters.
 
 =head1 VERSION
 
-Version 0.01
+Version 0.05
 
 =cut
 
-our $VERSION = '0.01';
+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;
@@ -64,7 +64,7 @@ sub _count_bits {
 
 =head2 C<new>
 
-L<Bit::MorseSignal::Emitter> object constructor. Currently does not take any optional argument.
+L<Bit::MorseSignals::Emitter> object constructor. Currently does not take any optional argument.
 
 =cut
 
@@ -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<type> option : C<$type> is then one of the C<BM_DATA_*> constants listed in L<Bit::MorseSignals/CONSTANTS>
 
@@ -176,6 +176,30 @@ sub pop {
  return $bit;
 }
 
+=head2 C<len>
+
+The length of the currently posted message.
+
+=cut
+
+sub len {
+ my ($self) = @_;
+ _check_self($self);
+ return $self->{len};
+}
+
+=head2 C<pos>
+
+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<reset>
 
 Cancels the current transfer, but does not empty the queue.
@@ -241,7 +265,7 @@ L<Bit::MorseSignals>, L<Bit::MorseSignals::Receiver>.
 
 =head1 AUTHOR
 
-Vincent Pit, C<< <perl at profvince.com> >>
+Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
 
 You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).