{
    "content": [
        {
            "type": "text",
            "text": "# Heap::Elem::Ref (perldoc)\n\n## NAME\n\nHeap::Elem::Ref - Object Reference Heap Elements\n\n## SYNOPSIS\n\nuse Heap::Elem::Ref( RefElem );\nuse Heap::Fibonacci;\nmy $heap = Heap::Fibonacci->new;\nmy $elem;\nforeach $i ( 1..100 ) {\n$obj = myObject->new( $i );\n$elem = RefElem( $obj );\n$heap->add( $elem );\n}\nwhile( defined( $elem = $heap->extracttop ) ) {\n# assume that myObject object have a method I<printable>\nprint \"Smallest is \", $elem->val->printable, \"\\n\";\n}\n\n## DESCRIPTION\n\nHeap::Elem::Ref is used to wrap object reference values into an element that can be managed on a\nheap. Each referenced object must have a method *cmp* which can compare itself with any of the\nother objects that have references on the same heap. These comparisons must be consistant with\nnormal arithmetic. The top of the heap will have the smallest (according to *cmp*) element still\nremaining. (See Heap::Elem::RefRev if you want the heap to always return the largest element.)\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **AUTHOR**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Heap::Elem::Ref",
        "section": "",
        "mode": "perldoc",
        "summary": "Heap::Elem::Ref - Object Reference Heap Elements",
        "synopsis": "use Heap::Elem::Ref( RefElem );\nuse Heap::Fibonacci;\nmy $heap = Heap::Fibonacci->new;\nmy $elem;\nforeach $i ( 1..100 ) {\n$obj = myObject->new( $i );\n$elem = RefElem( $obj );\n$heap->add( $elem );\n}\nwhile( defined( $elem = $heap->extracttop ) ) {\n# assume that myObject object have a method I<printable>\nprint \"Smallest is \", $elem->val->printable, \"\\n\";\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "Heap",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/Heap/3/json"
            },
            {
                "name": "Elem",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/Elem/3/json"
            },
            {
                "name": "RefRev",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/RefRev/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 17,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Heap::Elem::Ref - Object Reference Heap Elements\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Heap::Elem::Ref( RefElem );\nuse Heap::Fibonacci;\n\nmy $heap = Heap::Fibonacci->new;\nmy $elem;\n\nforeach $i ( 1..100 ) {\n$obj = myObject->new( $i );\n$elem = RefElem( $obj );\n$heap->add( $elem );\n}\n\nwhile( defined( $elem = $heap->extracttop ) ) {\n# assume that myObject object have a method I<printable>\nprint \"Smallest is \", $elem->val->printable, \"\\n\";\n}\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Heap::Elem::Ref is used to wrap object reference values into an element that can be managed on a\nheap. Each referenced object must have a method *cmp* which can compare itself with any of the\nother objects that have references on the same heap. These comparisons must be consistant with\nnormal arithmetic. The top of the heap will have the smallest (according to *cmp*) element still\nremaining. (See Heap::Elem::RefRev if you want the heap to always return the largest element.)\n\nThe details of the Elem interface are described in Heap::Elem.\n\nThe details of using a Heap interface are described in Heap.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "John Macdonald, john@perlwolf.com\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 1998-2007, O'Reilly & Associates.\n\nThis code is distributed under the same copyright terms as perl itself.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Heap(3), Heap::Elem(3), Heap::Elem::RefRev(3).\n",
                "subsections": []
            }
        }
    }
}