| 1 | #+############################################################################## | ||
| 2 | # # | ||
| 3 | # File: Messaging/Message/Queue/ZERO.pm # | ||
| 4 | # # | ||
| 5 | # Description: abstraction of a message queue returning empty messages # | ||
| 6 | # # | ||
| 7 | #-############################################################################## | ||
| 8 | |||
| 9 | # | ||
| 10 | # module definition | ||
| 11 | # | ||
| 12 | |||
| 13 | package Messaging::Message::Queue::ZERO; | ||
| 14 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 1 | our $VERSION = "1.7"; | |
| 17 | 1 | our $REVISION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); | |
| 18 | |||
| 19 | # | ||
| 20 | # inheritance | ||
| 21 | # | ||
| 22 | |||
| 23 | 1 | our @ISA = qw(Messaging::Message::Queue); | |
| 24 | |||
| 25 | # | ||
| 26 | # used modules | ||
| 27 | # | ||
| 28 | |||
| 29 | 1 | ▶ | use No::Worries::Die qw(dief); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | 1 | ▶ | use Params::Validate qw(validate_with); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 31 | |||
| 32 | # | ||
| 33 | # constructor | ||
| 34 | # | ||
| 35 | |||
| 36 | 1 | ▶ | sub new : method { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 37 | 1 | my($class, %option, $self); | |
| 38 | |||
| 39 | 1 | $class = shift(@_); | |
| 40 | 1 | %option = validate_with( | |
| 41 | params => \@_, | ||
| 42 | spec => {}, | ||
| 43 | allow_extra => 0, | ||
| 44 | ); | ||
| 45 | 1 | $self = {}; | |
| 46 | 1 | bless($self, $class); | |
| 47 | 1 | return($self); | |
| 48 | } | ||
| 49 | |||
| 50 | # | ||
| 51 | # Directory::Queue methods that can be used | ||
| 52 | # | ||
| 53 | |||
| 54 | 1 | ▶ | sub first : method { |
|
Subroutine
first: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 55 | 1 | return("first"); | |
| 56 | } | ||
| 57 | |||
| 58 | 0 | ▶ | sub next : method { ## no critic 'ProhibitBuiltinHomonyms' |
|
Subroutine
next: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 59 | 0 | return("next"); | |
| 60 | } | ||
| 61 | |||
| 62 | 2 | ▶ | sub count : method { |
|
Subroutine
count: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 63 | 2 | return(1); | |
| 64 | } | ||
| 65 | |||
| 66 | 0 | ▶ | sub purge : method { |
|
Subroutine
purge: not called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 67 | } | ||
| 68 | |||
| 69 | 0 | ▶ | sub path : method { |
|
Subroutine
path: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 70 | 0 | return("ZERO"); | |
| 71 | } | ||
| 72 | |||
| 73 | 0 | ▶ | sub id : method { |
|
Subroutine
id: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 74 | 0 | return("ZERO"); | |
| 75 | } | ||
| 76 | |||
| 77 | 0 | ▶ | sub touch : method { |
|
Subroutine
touch: not called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 78 | } | ||
| 79 | |||
| 80 | 1 | ▶ | sub lock : method { ## no critic 'ProhibitBuiltinHomonyms' |
|
Subroutine
lock: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 81 | 1 | return(1); | |
| 82 | } | ||
| 83 | |||
| 84 | 1 | ▶ | sub unlock : method { |
|
Subroutine
unlock: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 85 | 1 | return(1); | |
| 86 | } | ||
| 87 | |||
| 88 | 0 | ▶ | sub remove : method { |
|
Subroutine
remove: not called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 89 | } | ||
| 90 | |||
| 91 | 0 | ▶ | sub get : method { |
|
Subroutine
get: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 92 | 0 | return(""); | |
| 93 | } | ||
| 94 | |||
| 95 | # | ||
| 96 | # Directory::Queue methods that cannot be used | ||
| 97 | # | ||
| 98 | |||
| 99 | 0 | ▶ | sub add : method { |
|
Subroutine
add: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 100 | 0 | dief("unsupported method: add()"); | |
| 101 | } | ||
| 102 | |||
| 103 | 0 | ▶ | sub add_ref : method { |
|
Subroutine
add_ref: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 104 | 0 | dief("unsupported method: add_ref()"); | |
| 105 | } | ||
| 106 | |||
| 107 | 0 | ▶ | sub add_path : method { |
|
Subroutine
add_path: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 108 | 0 | dief("unsupported method: add_path()"); | |
| 109 | } | ||
| 110 | |||
| 111 | 0 | ▶ | sub get_ref : method { |
|
Subroutine
get_ref: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 112 | 0 | dief("unsupported method: get_ref()"); | |
| 113 | } | ||
| 114 | |||
| 115 | 0 | ▶ | sub get_path : method { |
|
Subroutine
get_path: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 116 | 0 | dief("unsupported method: get_path()"); | |
| 117 | } | ||
| 118 | |||
| 119 | 0 | ▶ | sub copy : method { |
|
Subroutine
copy: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 120 | 0 | dief("unsupported method: copy()"); | |
| 121 | } | ||
| 122 | |||
| 123 | # | ||
| 124 | # add a message object to the queue | ||
| 125 | # | ||
| 126 | |||
| 127 | 0 | ▶ | sub add_message : method { |
|
Subroutine
add_message: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 128 | 0 | dief("unsupported method: add_message()"); | |
| 129 | } | ||
| 130 | |||
| 131 | # | ||
| 132 | # get a message object from the queue | ||
| 133 | # | ||
| 134 | |||
| 135 | 1 | ▶ | sub get_message : method { |
|
Subroutine
get_message: called CC=1 SCAR=0.0
Pod
documented
| |||
| 136 | 1 | return(Messaging::Message->new()); | |
| 137 | } | ||
| 138 | |||
| 139 | 1 | 1; | |
| 140 | |||
| 141 | __DATA__ | ||