Class::MOP::Instance - Instance Meta Object The meta instance is used by attributes for low level storage. Using this API generally violates attribute encapsulation and is not recommended, instead look at "get_value" in Class::MOP::Attribute, "set_value" in Class::MOP::Attribute for the recommended way to fiddle with attribute values in a generic way, independent of how/whether accessors have been defined. Accessors can be found using "get_attribute" in Class::MOP::Class. This may seem like over-abstraction, but by abstracting this process into a sub-protocol we make it possible to easily switch the details of how an object's instance is stored with minimal impact. In most cases just subclassing this class will be all you need to do (see the examples; examples/ArrayBasedStorage.pod and examples/InsideOutClass.pod for details). Creates a new instance meta-object and gathers all the slots from the list of @attrs given. Processes arguments for compatibility. Returns the metaclass of Class::MOP::Instance.

Creation of Instances
This creates the appropriate structure needed for the instance and blesses it. This does just exactly what it says it does. This method has been deprecated but remains for compatibility reasons. None of the subclasses of Class::MOP::Instance ever bothered to actually make use of it, so it was deemed unnecessary fluff. Creates a shallow clone of $instance_structure.

Introspection
NOTE: There might be more methods added to this part of the API, we will add then when we need them basically. This returns the metaclass associated with this instance. This will return the current list of slots based on what was given to this object in "new". This will return true if $slot_name is a valid slot name. This method returns true when the meta instance must be recreated on any superclass changes. Defaults to false. This will return the current list of attributes (as Class::MOP::Attribute objects) based on what was given to this object in "new".

Operations on Instance Structures
An important distinction of this sub-protocol is that the instance meta-object is a different entity from the actual instance it creates. For this reason, any actions on slots require that the $instance_structure is passed into them. The names of these methods pretty much explain exactly what they do, if that is not enough then I suggest reading the source, it is very straightfoward.

Inlineable Instance Operations
Each meta-instance should override this method to tell Class::MOP if it's possible to inline the slot access. This is currently only used by Class::MOP::Immutable when performing optimizations. Yuval Kogman <nothingmuch@woobling.com> Stevan Little <stevan@iinteractive.com> Copyright 2006-2008 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.