Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.648.227 Times

Class::STL::Containers for Linux 0.35

Company: Mario Gaffiero
Date Added: November 29, 2013  |  Visits: 307

Class::STL::Containers for Linux

Report Broken Link
Printer Friendly Version

Product Homepage
Download (16 downloads)

Class::STL::Containers is a Perl modulethat provides a framework for rapid Object Oriented Perl application development. It consists of a number of base classes that are similar to the C++/STL framework, plus a number of helper classes which provide the glue to transparently generate common functions, and will enable you to put your Perl application together very quickly.<br /><br />The STL functionality provided consists of containers, algorithms, utilities and iterators as follows:<br /><br />Containers<br /><br /> vector, list, deque, queue, priority_queue, stack, tree.<br /><br />Iterators<br /><br /> iterator, bidirectional_iterator, reverse_iterator, forward_iterator.<br /><br />Algorithms<br /><br /> find, find_if, for_each, transform, count, count_if, copy, copy_backward, remove, remove_if, remove_copy, remove_copy_if, replace, replace_if, replace_copy, replace_copy_if.<br /><br />Utilities<br /><br /> equal_to, not_equal_to, greater, greater_equal, less, less_equal, compare, bind1st, bind2nd, mem_fun, ptr_fun, ptr_fun_binary, matches, matches_ic, logical_and, logical_or, multiplies, divides, plus, minus, modulus.<br /><br />SYNOPSIS<br /><br /> use stl;<br /><br /> # Deque container...<br /> my $d = stl::deque(qw(first second third fourth));<br /> $d->push_back($d->factory('fifth'));<br /> $d->push_front($d->factory('seventh'));<br /> $d->pop_front(); # remove element at front.<br /> $d->pop_back(); # remove element at back.<br /> stl::for_each($d->begin(), $d->end(), ptr_fun('::myprint'));<br /> <br /> sub myprint { print "Data:", @_, "<br />"; }<br /><br /> # Copy constructor...<br /> my $d_copy = stl::deque($d);<br /><br /> # Algorithms -- find_if()<br /> print "Element 'second' was ",<br /> stl::find_if($d->begin(), $d->end(), stl::bind1st(stl::equal_to(), 'second'))<br /> ? 'found' : 'not found', "<br />";<br /><br /> # Algorithms -- count_if()<br /> print "Number of elements matching /o/ = ",<br /> stl::count_if($d->begin(), $d->end(), stl::bind2nd(stl::matches(), 'o')),<br /> "<br />"; # prints '2' -- matches 'second' and 'fourth'<br /><br /> # Algorithms -- transform()<br /> stl::transform($d->begin(), $d->end(), $d2->begin(), stl::ptr_fun('ucfirst'));<br /> stl::transform($d->begin(), $d->end(), $d2->begin(), $d3->begin(), stl::ptr_fun_binary('::mybfun'));<br /> sub mybfun { return $_[0] . '-' . $_[1]; }<br /><br /> # Function Adaptors -- bind1st<br /> stl::remove_if($v->begin(), $v->end(), stl::bind1st(stl::equal_to(), $v->back()));<br /> # remove element equal to back() -- ie remove last element.<br /> stl::remove_if($v->begin(), $v->end(), stl::bind2nd(stl::matches(), '^fi'));<br /> # remove all elements that match reg-ex '^fi'<br /><br /> # Sort list according to elements cmp() function<br /> $v->sort();<br /><br /> # Queue containers -- FIFO<br /> my $v = stl::queue(qw(first second third fourth fifth));<br /> print 'Back:', $v->back()->data(), "<br />" # Back:fifth<br /> print 'Front:', $v->front()->data(), "<br />" # Front:first<br /> $v->pop(); # pop element first in<br /> $v->push($v->factory('sixth')), "<br />"<br /> print 'Back:', $v->back()->data(), "<br />" # Back:sixth<br /> print 'Front:', $v->front()->data(), "<br />" # Front:second<br /><br /> # Iterators<br /> for (my $i = $v->begin(); !$i->at_end(); ++$i)<br /> {<br /> print "Data:", $i->p_element()->data();<br /> }<br /><br /> # Iterators -- reverse_iterator<br /> my $ri = stl::reverse_iterator($v->iter())->first();<br /> while (!$ri->at_end())<br /> {<br /> print "Data:", $ri->p_element()->data();<br /> ++$ri;<br /> }<br /><br /> # Inserters<br /> my $three2one = stl::list(qw(3 2 1));<br /> my $four2six = stl::list(qw(4 5 6));<br /> my $seven2nine = stl::list(qw(7 8 9));<br /> my $result = stl::list();<br /> stl::copy($three2one->begin(), $three2one->end(), stl::front_inserter($result));<br /> stl::copy($seven2nine->begin(), $seven2nine->end(), stl::back_inserter($result));<br /> my $iseven = stl::find($result->begin(), $result->end(), 7);<br /> stl::copy($four2six->begin(), $four2six->end(), stl::inserter($result, $iseven));<br /> # $result now contains (1, 2, 3, 4, 5, 6, 7, 8, 9);<br /><br /> # Vector container...<br /> my $v = stl::vector(qw(first second third fourth fifth));<br /> <br /> my $e = $v->at(0); # return pointer to first element.<br /> print 'Element-0:', $e->data(), "<br />"; # Element-0:first<br /> $e = $v->at($v->size()-1); # return pointer to last element.<br /> print 'Element-last:', $e->data(), "<br />"; # Element-last:fifth<br /> $e = $v->at(2); # return pointer to 3rd element (idx=2).<br /> print 'Element-2:', $e->data(), "<br />"; # Element-2:third<br /><br /> # Priority Queue<br /> my $p = stl::priority_queue();<br /> $p->push($p->factory(priority => 10, data => 'ten'));<br /> $p->push($p->factory(priority => 2, data => 'two'));<br /> $p->push($p->factory(priority => 12, data => 'twelve'));<br /> $p->push($p->factory(priority => 3, data => 'three'));<br /> $p->push($p->factory(priority => 11, data => 'eleven'));<br /> $p->push($p->factory(priority => 1, data => 'one'));<br /> $p->push($p->factory(priority => 1, data => 'one-2'));<br /> $p->push($p->factory(priority => 12, data => 'twelve-2'));<br /> $p->push($p->factory(priority => 20, data => 'twenty'), $p->factory(priority => 0, data => 'zero'));<br /> print "$p->size()=", $p->size(), "<br />";<br /> print "$p->top():", $p->top(), "<br />";<br /> $p->top()->priority(7); # change priority for top element.<br /> $p->refresh(); # refresh required after priority change.<br /> $p->pop(); # remove element with highest priority.<br /> print "$p->top():", $p->top(), "<br />";<br /><br /> # Clone $d container into $d1...<br /> my $d1 = $d->clone();<br /><br /> my $d2 = stl::deque(qw(sixth seventh eight));<br /><br /> # Append $d container to end of $d2 container...<br /> $d2 += $d;<br /><br /> # DataMembers -- Class builder helper...<br /> {<br /> package MyClass;<br /> use Class::STL::ClassMembers (<br /> qw(attrib1 attrib2), # data members<br /> Class::STL::ClassMembers::DataMember->new(<br /> name => 'attrib3', default => '100', validate => '^d+$'), # data member with attributes<br /> Class::STL::ClassMembers::DataMember->new(<br /> name => 'attrib4', default => 'med', validate => '^(high|med|low)$'),<br /> );<br /> use Class::STL::ClassMembers::Constructor; # produce class new() function<br /> }<br /> my $cl = MyClass->new(attrib1 => 'hello', attrib2 => 'world');<br /> print $cl->attrib1(), " ", $cl->attrib2(), "<br />"; # 'hello world'<br /> $cl->attrib1(ucfirst($cl->attrib1));<br /> $cl->attrib2(ucfirst($cl->attrib2));<br /> print $cl->attrib1(), " ", $cl->attrib2(), "<br />"; # 'Hello World'<br /> $cl->attrib4('avg'); # Causes progam to die with '** Function attrib2 value failed validation...'

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: 09second09 Algorithms Attrib Class Class Stl Container Containers Dgtend Egtdata Element Elements Fourth Iseven Linux Pgtpushpgtfactorypriority Pointer Print Priority Quotdataquot Quotquot Remove Return Stl Stl Containers
Users rating: 0/10

License: Freeware Size: 61.44 KB
More Reviews or Write Review

Libraries  -  Class::Maker 0.05.18
Class::Maker Perl module contains classes, reflection, schema, serialization, attribute- and multiple inheritance. SYNOPSIS use Class::Maker qw(class); class Human, { isa => [qw( ParentClass )], public => { string => [qw(name lastname)],...
49.15 KB  
Education  -  ClaSS 0.9.38
ClaSS (ClaSS Student System) is a complete student tracking, reporting and information management system. The latest web-application methods allow the school community access. ClaSS aims to be the ubiquitous classroom information assistant for school
997.24 KB  
Productivity  -  Omrin Afval
Weet precies wanneer uw container wordt geleegd met deze officiele Omrin Afval App. In de Omrin Afval App staan uw inzameldata, de dichtstbijzijnde containers, nuttige adressen en de scheidingswijzer. U kunt in de Afval App een handige reminder...
2 MB  
Libraries  -  Class::Meta 0.53
Class::Meta is a Perl class automation, introspection, and data validation. SYNOPSIS Generate a class: package MyApp::Thingy; use strict; use Class::Meta; use Class::Meta::Types::String; use Class::Meta::Types::Numeric; BEGIN { #...
61.44 KB  
Libraries  -  Class::HPLOO 0.23
Class::HPLOO is an easier way to declare classes on Perl, based in the popular class {...} style and ePod. USAGE use Class::HPLOO ; class Foo extends Bar , Baz { use LWP::Simple qw(get) ; ## import the method get() to this package. attr...
27.65 KB  
Libraries  -  Class::Cloneable 0.03
Class::Cloneable is a base class for Cloneable objects. SYNOPSIS package MyObject; our @ISA = (Class::Cloneable); # calling clone on an instance of MyObject # will give you full deep-cloning functionality This module provides a flexible...
8.19 KB  
Libraries  -  PHP HTML Form Generation and Validation Class 1.0 Beta 3
PHP HTML Form Generation and Validation Class is a PHP class for easy HTML form generation and validation. If youre a web developer you know that designing HTML forms and writing the PHP code for their validation is a really dull task. And if...
133.12 KB  
Libraries  -  Class::Generate 1.09
Class::Generate is a Perl module that can generate Perl class hierarchies. SYNOPSIS use Class::Generate qw(class subclass delete_class); # Declare class Class_Name, with the following types of members: class Class_Name => [ s => $, #...
53.25 KB  
Libraries  -  PHP Advanced Graphing Class 1.4
PHP Advanced Graphing Class is a PHP class that can be used to generate line, bar, and 2D/3D pie graphs from multiple data sets. PHP Advanced Graphing Class offers many style and data formatting options. The graphs can be built from data defined...
Modules  -  Credit Class Documentation 1.1
This is a first try at some documentation for programmers wishing to use the credit class to write easily installable discount systems.I've never ever written docs before, so don't expect o'reilly class stuff.It s a plain txt document, but I hope...
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Linux Software  -  SLAX 6.0+
Slax is a modern, portable, small and fast Linux operating system with a modular approach and outstanding design. Despite its small size, Slax provides a wide collection of pre-installed software for daily use, including a well organized graphical...
190 KB  
Linux Software  -  GTK+ 2.5
GTK+, which stands for the GIMP Toolkit, is a library for creating graphical user interfaces for the X Window System. It is designed to be small, efficient, and flexible. GTK+ is written in C with a very object-oriented approach. Language bindings...
60 MB  
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB