Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    SPOPS::Iterator 0.87

    Download button

    No screenshots available
    Downloads: 279  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Chris Winters | More programs
    Perl Artistic License / FREE
    January 6th, 2007, 05:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    SPOPS::Iterator description

    SPOPS::Iterator is a class to cycle through results and return SPOPS objects.

    SPOPS::Iterator is a class to cycle through results and return SPOPS objects.

    SYNOPSIS

    my $iter = $spops_class->fetch_iterator({ where => 'last_name like ?',
    value => [ 'smi%' ] });
    while ( $iter->has_next ) {
    my $object = $iter->get_next;
    print "Object ID: ", $object->id, " at position: ",
    $iter->position, "n";
    }

    One of the problems with current SPOPS implementations is that retrieving groups of objects is an all-or-nothing affair -- you get a list with all instantiated objects or you do not retrive them in the first place. This can be quite memory intensive, particularly when a user executes a query that can return thousands of objects back at one time.
    This class -- or, more specifically, implementations of the interface in this class -- aims to change that. Instead of returning a list of objects from a group retrieval, you get back an SPOPS::Iterator object. This object has a simple interface to cycle forward through objects and let you deal with them one at a time.

    It does not keep track of these for you -- once you request the SPOPS object through the get_next() call, the iterator loses track of it. The iterator does keep track of the current count (on a 1-based scheme) and whether you are currently 'on' the first or last element.

    It is important to state that this works within the realm of other SPOPS capabilities -- just like the fetch_group() method, all objects returned will get checked for security, and if a user cannot see a certain object it does not get returned and the iterator moves onto the next object.

    As a result, users will never create an SPOPS::Iterator object themselves. Instead, the object is returned from a method in a SPOPS implementation class, such as SPOPS::DBI.

    The initial module documentation is for the interface; there is also a section of creating a subclass of this module for SPOPS authors.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    cycle results | SPOPS objects | Perl module | SPOPS::Iterator | cycle | results

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM