1MooseX::Clone::Meta::AtUtsMreoirobsuCetoXen::t::rCTilrboaunitete::d::MSPetetorarl:a:bDAlotectCurlmioebnnuett(ae3t:)i:oTnrait::StorableClone(3)
2
3
4
6 MooseX::Clone::Meta::Attribute::Trait::StorableClone - The
7 Moose::Meta::Attribute trait for deeply cloning attributes using
8 Storable.
9
11 # see MooseX::Clone
12
13 has foo => (
14 traits => [qw(StorableClone)],
15 isa => "Something",
16 );
17
18 my $clone = $object->clone; # $clone->foo will equal Storable::dclone($object->foo)
19
21 This meta attribute trait provides a "clone_value" method, in the
22 spirit of "get_value" and "set_value". This allows clone methods such
23 as the one in MooseX::Clone to make use of this per-attribute cloning
24 behavior.
25
27 Deriving this role for your own cloning purposes is encouraged.
28
29 This will allow your fine grained cloning semantics to interact with
30 MooseX::Clone in the RightX way.
31
33 clone_only_objects
34 Whether or not Data::Visitor should be used to clone arbitrary
35 structures. Objects found in these structures will be cloned using
36 clone_object_value.
37
38 If true then non object values will be copied over in shallow
39 cloning semantics (shared reference).
40
41 Defaults to false (all reference will be cloned).
42
43 clone_visitor_config
44 A hash ref used to construct "clone_visitor". Defaults to the empty
45 ref.
46
47 This can be used to alter the cloning behavior for non object
48 values.
49
50 clone_visitor
51 The Data::Visitor::Callback object that will be used to clone.
52
53 It has an "object" handler that delegates to "clone_object_value"
54 and sets "tied_as_objects" to true in order to deeply clone tied
55 structures while retaining magic.
56
57 Only used if "clone_only_objects" is false and the value of the
58 attribute is not an object.
59
61 clone_value $target, $proto, %args
62 Clones the value the attribute encapsulates from $proto into
63 $target.
64
65 clone_value_data $value, %args
66 Does the actual cloning of the value data by delegating to a
67 "clone" method on the object if any.
68
69 If the object does not support a "clone" method an error is thrown.
70
71 If the value is not an object then it will not be cloned.
72
73 In the future support for deep cloning of simple refs will be added
74 too.
75
76 clone_object_value $object, %args
77 This is the actual workhorse of "clone_value_data".
78
79 clone_any_value $value, %args
80 Uses "clone_visitor" to clone all non object values.
81
82 Called from "clone_value_data" if the value is not an object and
83 "clone_only_objects" is false.
84
85
86
87perl v5.12.1 MooseX::Clo2n0e1:0:-M0e7t-a2:2:Attribute::Trait::StorableClone(3)