| 1 | package Protocol::FIX::TagsAccessor; | ||||||||||
| 2 | |||||||||||
| 3 | 19 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 19 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 19 | our $VERSION = '0.08'; ## VERSION | |||||||||
| 7 | |||||||||||
| 8 | =head1 NAME | ||||||||||
| 9 | |||||||||||
| 10 | Protocol::FIX::TagsAccessor - access to tags of deserialized FIX messages | ||||||||||
| 11 | |||||||||||
| 12 | =cut | ||||||||||
| 13 | |||||||||||
| 14 | =head1 METHODS | ||||||||||
| 15 | |||||||||||
| 16 | =head3 new | ||||||||||
| 17 | |||||||||||
| 18 | new($class, $tag_pairs) | ||||||||||
| 19 | |||||||||||
| 20 | Creates new TagsAccessor (performed by Parser). Not for direct usage | ||||||||||
| 21 | by end-users. | ||||||||||
| 22 | |||||||||||
| 23 | =cut | ||||||||||
| 24 | |||||||||||
| 25 | 54 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 26 | 54 | my ($class, $tag_pairs) = @_; | |||||||||
| 27 | 54 | my %by_name; | |||||||||
| 28 | 54 | ▶ | for (my $idx = 0; $idx < @$tag_pairs; $idx += 2) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 134 | my $composite = $tag_pairs->[$idx]; | |||||||||
| 30 | # value is either value (i.e. string) or another TagAccessor | ||||||||||
| 31 | 134 | my $value = $tag_pairs->[$idx + 1]; | |||||||||
| 32 | 134 | $by_name{$composite->{name}} = $value; | |||||||||
| 33 | } | ||||||||||
| 34 | 54 | return bless \%by_name, $class; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | =head3 value | ||||||||||
| 38 | |||||||||||
| 39 | value($self, $name) | ||||||||||
| 40 | |||||||||||
| 41 | Returns value. Please, refer to L<MessageInstance/value> | ||||||||||
| 42 | |||||||||||
| 43 | =cut | ||||||||||
| 44 | |||||||||||
| 45 | 82 | ▶ | sub value { | ||||||||
|
Subroutine
value: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 46 | 82 | my ($self, $name) = @_; | |||||||||
| 47 | 82 | return $self->{$name}; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 19 | 1; | |||||||||