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

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

Serving Software Downloads in 956 Categories, Downloaded 50.347.014 Times

Class::Bits 0.05

  Date Added: November 06, 2010  |  Visits: 950

Class::Bits

Report Broken Link
Printer Friendly Version


Product Homepage
Download (90 downloads)



Class::Bits is a Perl module with class wrappers around bit vectors. SYNOPSIS package MyClass; use Class::Bits; make_bits( a => 4, # 0..15 b => 1, # 0..1 c => 1, # 0..1 d => 2, # 0..3 e => s4 # -8..7 f => s1 # -1..0 ); package; $o=MyClass->new(a=>12, d=>2); print "o->b is ", $o->b, "n"; print "bit vector is ", unpack("h*", $$o), "n"; $o2=$o->new(); $o3=MyClass->new($string); ABSTRACT Class::Bits creates class wrappers around bit vectors. Class::Bits defines classes using bit vectors as storage. Object attributes are stored in bit fields inside the bit vector. Bit field sizes have to be powers of 2 (1, 2, 4, 8, 16 or 32). There is a class constructor subroutine: make_bits( field1 => size1, field2 => size2, ...) exports in the calling package a ctor, accessor methods, some utility methods and some constants: Sizes can be prefixed by s or u to define signedness of the field. Default is unsigned. $class->new() creates a new object with all zeros. $class->new($bitvector) creates a new object over $bitvector. $class->new(%fields) creates a new object and initializes its fields with the values in %fields. $obj->new() clones an object. $obj->$field() $obj->$field($value) gets or sets the value of the bit field $field inside the bit vector. $class->length $obj->lenght returns the size in bits of the bit vector used for storage. $class->keys $obj->keys returns an array with the names of the object attributes $obj->as_hash returns a flatten hash with the object attributes, i.e.: my %values=$obj->as_hash; %INDEX hash with offsets as used by vec perl operator (to get an offset in bits, the value has to be multiplied by the corresponding bit field size). %SIZES hash with bit field sizes in bits. %SIGNED hash with signedness of the fields Bit fields are packed in the bit vector in the order specified as arguments to make_bits. Bit fields are padded inside the bit vector, i.e. a class created like make_bits(A=>1, B=>2, C=>1, D=>4, E=>8, F=>16); will have the layout AxBBCxxx DDDDxxxx EEEEEEEE xxxxxxxx FFFFFFFF FFFFFFFF.

Requirements: No special requirements
Platforms: Linux
Keyword: Bit Bit Field Bit Vector Bits Class Classbits Field Libraries Myclass New Object Perl Module Programming
Users rating: 0/10

License: Freeware Size: 4.1 KB
USER REVIEWS
More Reviews or Write Review


CLASS::BITS RELATED
Libraries  -  Bit::Vector 6.4
Bit::Vector is an efficient bit vector, set of integers and "big int" math library. CLASS METHODS Version $version = Bit::Vector->Version(); Word_Bits $bits = Bit::Vector->Word_Bits(); # bits in a machine word Long_Bits $bits =...
133.12 KB  
Programming  -  Bit::Vector for Linux 6.9
Bit::Vector is an efficient bit vector, set of integers and "big int" math library. CLASS METHODS Version $version = Bit::Vector->Version(); Word_Bits $bits = Bit::Vector->Word_Bits(); # bits in a...
133.12 KB  
Libraries  -  XML::XMetaL 0.52
XML::XMetaL is a Perl module with dispatch class for XML::XMetaL development framework. The XML::XMetaL class is a dispatcher for XMetaL customization handlers. XML:XMetaL objects are singletons. There can be only one XML::XMetaL object...
24.58 KB  
Libraries  -  Number::Encode 1.00
Number::Encode is a Perl module to encode bit strings into digit strings. SYNOPSIS use Number::Encode qw(nonuniform uniform); Provides a mechanism to convert arbitrary bit-strings into numeric digit strings. The transformation can be uniform...
2.05 KB  
Libraries  -  Class::Meta::Declare 0.04
Class::Meta::Declare is a Perl module deprecated in favor of Class::Meta::Express. SYNOPSIS This was a first attempt at making a saner interface for Class::Meta. It is nicer, but Class::Meta::Express is nicer still. Go use that one. package...
15.36 KB  
Libraries  -  Exception::Class 1.23
Exception::Class is a Perl module that allows you to declare real exception classes in Perl. SYNOPSIS use Exception::Class ( MyException, AnotherException => { isa => MyException }, YetAnotherException => { isa => AnotherException,...
16.38 KB  
Libraries  -  Class::Meta::Express 0.04
Class::Meta::Express is a Perl module for concise, expressive creation of Class::Meta classes. Synopsis package My::Contact; use Class::Meta::Express; class { meta contact => ( default_type => string ); has name; has contact => (...
9.22 KB  
Libraries  -  Class::DBI::FormBuilder 0.481
Class::DBI::FormBuilder is a Perl module with Class::DBI/CGI::FormBuilder integration. SYNOPSIS package Film; use strict; use warnings; use base Class::DBI; use Class::DBI::FormBuilder; # for indented output: # use...
46.08 KB  
Libraries  -  Class::DBI::AutoIncrement 0.05
Class::DBI::AutoIncrement is a Perl module to emulate auto-incrementing columns on Class::DBI subclasses. SYNOPSIS Lets assume you have a project making use of Class::DBI. You have implemented a subclass of Class::DBI called MyProject::DBI...
8.19 KB  
Libraries  -  Class::DBI::Plugin::FilterOnClick 1.0
Class::DBI::Plugin::FilterOnClick is a Perl module to generate browsable and searchable HTML Tables using FilterOnClick in conjunction with Class::DBI. SYNOPSIS # Inside of your sub-class of Class::DBI add these lines: use...
24.58 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB