{
    "content": [
        {
            "type": "text",
            "text": "# Class::MOP::Instance (info)\n\n## NAME\n\nClass::MOP::Instance - Instance Meta Object\n\n## DESCRIPTION\n\nThe Instance Protocol controls the creation of object instances, and\nthe storage of attribute values in those instances.\n\n## Sections\n\n- **Class::MOP::Instance(3User Contributed Perl DocumentaClass::MOP::Instance(3pm)**\n- **NAME**\n- **VERSION**\n- **DESCRIPTION**\n- **METHODS**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Class::MOP::Instance",
        "section": "",
        "mode": "info",
        "summary": "Class::MOP::Instance - Instance Meta Object",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "Class::MOP::Instance(3User Contributed Perl DocumentaClass::MOP::Instance(3pm)",
                "lines": 1,
                "subsections": []
            },
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 119,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "Class::MOP::Instance(3User Contributed Perl DocumentaClass::MOP::Instance(3pm)": {
                "content": "",
                "subsections": []
            },
            "NAME": {
                "content": "Class::MOP::Instance - Instance Meta Object\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 2.2200\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The Instance Protocol controls the creation of object instances, and\nthe storage of attribute values in those instances.\n\nUsing this API directly in your own code violates encapsulation, and we\nrecommend that you use the appropriate APIs in Class::MOP::Class and\nClass::MOP::Attribute instead. Those APIs in turn call the methods in\nthis class as appropriate.\n\nThis class also participates in generating inlined code by providing\nsnippets of code to access an object instance.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "Object construction\nClass::MOP::Instance->new(%options)\nThis method creates a new meta-instance object.\n\nIt accepts the following keys in %options:\n\no       associatedmetaclass\n\nThe Class::MOP::Class object for which instances will be\ncreated.\n\no       attributes\n\nAn array reference of Class::MOP::Attribute objects. These\nare the attributes which can be stored in each instance.\n\nCreating and altering instances\n$metainstance->createinstance\nThis method returns a reference blessed into the associated\nmetaclass's class.\n\nThe default is to use a hash reference. Subclasses can override\nthis.\n\n$metainstance->cloneinstance($instance)\nGiven an instance, this method creates a new object by making\nshallow clone of the original.\n\nIntrospection\n$metainstance->associatedmetaclass\nThis returns the Class::MOP::Class object associated with the meta-\ninstance object.\n\n$metainstance->getallslots\nThis returns a list of slot names stored in object instances. In\nalmost all cases, slot names correspond directly attribute names.\n\n$metainstance->isvalidslot($slotname)\nThis will return true if $slotname is a valid slot name.\n\n$metainstance->getallattributes\nThis returns a list of attributes corresponding to the attributes\npassed to the constructor.\n\nOperations on Instance Structures\nIt's important to understand that the meta-instance object is a\ndifferent entity from the actual instances it creates. For this reason,\nany operations on the $instancestructure always require that the\nobject instance be passed to the method.\n\n$metainstance->getslotvalue($instancestructure, $slotname)\n$metainstance->setslotvalue($instancestructure, $slotname, $value)\n$metainstance->initializeslot($instancestructure, $slotname)\n$metainstance->deinitializeslot($instancestructure, $slotname)\n$metainstance->initializeallslots($instancestructure)\n$metainstance->deinitializeallslots($instancestructure)\n$metainstance->isslotinitialized($instancestructure, $slotname)\n$metainstance->weakenslotvalue($instancestructure, $slotname)\n$metainstance->slotvalueisweak($instancestructure, $slotname)\n$metainstance->strengthenslotvalue($instancestructure, $slotname)\n$metainstance->reblessinstancestructure($instancestructure,\n$newmetaclass)\nThe exact details of what each method does should be fairly obvious\nfrom the method name.\n\nInlinable Instance Operations\n$metainstance->isinlinable\nThis is a boolean that indicates whether or not slot access\noperations can be inlined. By default it is true, but subclasses\ncan override this.\n\n$metainstance->inlinecreateinstance($classvariable)\nThis method expects a string that, when inlined, will become a\nclass name. This would literally be something like '$class', not an\nactual class name.\n\nIt returns a snippet of code that creates a new object for the\nclass. This is something like \" bless {}, $classname \".\n\n$metainstance->inlinegetislvalue\nReturns whether or not \"inlinegetslotvalue\" is a valid lvalue.\nThis can be used to do extra optimizations when generating inlined\nmethods.\n\n$metainstance->inlineslotaccess($instancevariable, $slotname)\n$metainstance->inlinegetslotvalue($instancevariable, $slotname)\n$metainstance->inlinesetslotvalue($instancevariable, $slotname,\n$value)\n$metainstance->inlineinitializeslot($instancevariable, $slotname)\n$metainstance->inlinedeinitializeslot($instancevariable, $slotname)\n$metainstance->inlineisslotinitialized($instancevariable,\n$slotname)\n$metainstance->inlineweakenslotvalue($instancevariable, $slotname)\n$metainstance->inlinestrengthenslotvalue($instancevariable,\n$slotname)\nThese methods all expect two arguments. The first is the name of a\nvariable, than when inlined, will represent the object instance.\nTypically this will be a literal string like '$[0]'.\n\nThe second argument is a slot name.\n\nThe method returns a snippet of code that, when inlined, performs\nsome operation on the instance.\n\n$metainstance->inlinereblessinstancestructure($instancevariable,\n$classvariable)\nThis takes the name of a variable that will, when inlined,\nrepresent the object instance, and the name of a variable that will\nrepresent the class to rebless into, and returns code to rebless an\ninstance into a class.\n\nIntrospection\nClass::MOP::Instance->meta\nThis will return a Class::MOP::Class instance for this class.\n\nIt should also be noted that Class::MOP will actually bootstrap\nthis module by installing a number of attribute meta-objects into\nits metaclass.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "o   Stevan Little <stevan@cpan.org>\n\no   Dave Rolsky <autarch@urth.org>\n\no   Jesse Luehrs <doy@cpan.org>\n\no   Shawn M Moore <sartak@cpan.org>\n\no    ' (Yuval Kogman) <nothingmuch@woobling.org>\n\no   Karen Etheridge <ether@cpan.org>\n\no   Florian Ragwitz <rafl@debian.org>\n\no   Hans Dieter Pearcey <hdp@cpan.org>\n\no   Chris Prather <chris@prather.org>\n\no   Matt S Trout <mstrout@cpan.org>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is copyright (c) 2006 by Infinity Interactive, Inc.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n\nperl v5.34.0                      2022-02-06         Class::MOP::Instance(3pm)",
                "subsections": []
            }
        }
    }
}