| 1 | package TUI::Objects::Const; | ||
| 2 | # ABSTRACT: Constants for object and collection components | ||
| 3 | |||
| 4 | 37 | ▶ | use 5.010; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 37 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 37 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 37 | our $VERSION = '2.000002'; | |
| 9 | 37 | $VERSION =~ tr/_//d; | |
| 10 | 37 | our $AUTHORITY = 'cpan:BRICKPOOL'; | |
| 11 | |||
| 12 | 37 | ▶ | use Exporter 'import'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 37 | our @EXPORT_OK = qw( | |
| 14 | ccNotFound | ||
| 15 | maxCollectionSize | ||
| 16 | ); | ||
| 17 | |||
| 18 | 37 | our %EXPORT_TAGS = ( | |
| 19 | ); | ||
| 20 | |||
| 21 | # add all the other %EXPORT_TAGS ":class" tags to the ":all" class and | ||
| 22 | # @EXPORT_OK, deleting duplicates | ||
| 23 | { | ||
| 24 | 37 | my %seen; | |
| 25 | push | ||
| 26 | @EXPORT_OK, | ||
| 27 | 0 | grep {!$seen{$_}++} @{$EXPORT_TAGS{$_}} | |
| 28 | 37 | foreach keys %EXPORT_TAGS; | |
| 29 | push | ||
| 30 | 37 | @{$EXPORT_TAGS{all}}, | |
| 31 | @EXPORT_OK; | ||
| 32 | } | ||
| 33 | |||
| 34 | 37 | ▶ | use Config; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 35 | 37 | ▶ | use TUI::Const qw( UINT_MAX ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 36 | |||
| 37 | 37 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 38 | 37 | ccNotFound => -1 | |
| 39 | 37 | }; | |
| 40 | |||
| 41 | # The calculation of 'maxCollectionSize' uses the size of a pointer to | ||
| 42 | # determine the maximum number of elements in the collection. | ||
| 43 | 37 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 44 | 37 | maxCollectionSize => int( ( UINT_MAX - 16 ) / $Config{ptrsize} ), | |
| 45 | 37 | }; | |
| 46 | |||
| 47 | 37 | 1 | |
| 48 | |||
| 49 | __END__ | ||