blib/lib/SPVM/EqualityChecker/Address.pm untested

filter: Statementstmt n/a Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a SCAR -
1 package SPVM::EqualityChecker::Address;
2  
3 1;
4  
5 =head1 Name
6  
7 SPVM::EqualityChecker::Address - a callback implementation of L<EqualityChecker|SPVM::EqualityChecker> to check if the memory addresses of the two objects are equal.
8  
9 =head1 Usage
10
11 use EqualityChecker::Address;
12
13 my $equality_checker = EqualityChecker::Address->new;
14
15 my $point1 = Point->new(1, 2);
16 my $point2 = $point1;
17 my $point3 = Point->new(1, 2);
18
19 # Equals
20 my $is_equal = $equality_checker->($point1, $point2);
21
22 # Not equals
23 my $is_equal = $equality_checker->($point1, $point3);
24  
25 =head1 Description
26  
27 L<EqualityChecker::Address|SPVM::EqualityChecker::Address> is a callback implementation of L<EqualityChecker|SPVM::EqualityChecker> to check if the memory addresses of the two objects are equal.
28  
29 =head1 Class Methods
30  
31 =head2 new
32  
33 C<static method new : L<EqualityChecker::Address|SPVM::EqualityChecker::Address> ();>
34  
35 Create a new L<EqualityChecker::Address|SPVM::EqualityChecker::Address> object.
36  
37 =head1 Interface Method Implementation
38  
39 C<method : int ($object1 : object, $object2 : object);>
40  
41 If the address of the two objects are equal, return 1. Otherwise, return 0.
42  
43 =head1 Copyright & License
44  
45 Copyright (c) 2023 Yuki Kimoto
46  
47 MIT License