Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Development (http://www.linux-archive.org/debian-development/)
-   -   Bug#682804: ITP: libtenum -- C++ metaprogramming library to make enums a little bit nicer (http://www.linux-archive.org/debian-development/687449-bug-682804-itp-libtenum-c-metaprogramming-library-make-enums-little-bit-nicer.html)

Beren Minor 07-25-2012 08:30 PM

Bug#682804: ITP: libtenum -- C++ metaprogramming library to make enums a little bit nicer
 
Package: wnpp
Severity: wishlist
Owner: Beren Minor <beren.minor+debian@gmail.com>

* Package name : libtenum
Version : 0.9.4
Upstream Author : Beren Minor <beren.minor+debian@gmail.com>
* URL : https://github.com/berenm/libtenum
* License : BSL-1.0
Programming Lang: C++
Description : C++ metaprogramming library to make enums a little bit
nicer


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120725203057.6081.95932.reportbug@m570tu.joberno n.fr">http://lists.debian.org/20120725203057.6081.95932.reportbug@m570tu.joberno n.fr

Salvo Tomaselli 07-26-2012 09:38 AM

Bug#682804: ITP: libtenum -- C++ metaprogramming library to make enums a little bit nicer
 
> Description : C++ metaprogramming library to make enums a little bit
> nicer
if you could make that description more meaningful, _that_ would be very nice

--
Salvo Tomaselli

Beren Minor 07-26-2012 01:57 PM

Bug#682804: ITP: libtenum -- C++ metaprogramming library to make enums a little bit nicer
 
This is a header only library to wrap C++ enums and automatically
provide some functionality for (de)serialization from text streams. It
also provides some different semantics on the way enumerations can be
combined.
I can give more detail as I'm the author of the library, but I'm not
sure how to summarize this in one line for the bug title.

The most obvious use-case for it is to read and write key combination
to key mapping files. For example "Alt+S" could automatically be
parsed using the "Bit field" concept as the bitwise or combination of
enum values "Alt" and "S".
Some test cases and samples are also available in the source code:
https://github.com/berenm/libtenum/tree/master/test.

Here is an excerpt of the README:

This library introduces three new variation over the enum concept. The
main difference between them is the way these enums are (de)serialized
and the available enum / enum and enum / integer operators when this
is meaningful (only when using C++0x).

- Static enums only allow explicitely defined constants (with
specified or implicit integer values), any other value will result in
a (de)serialization to special value "unknown".

- Dynamic enums allow explicitely defined constants and offsets from
these constants, within a given global range (from the first constant
to the specified upper integer limit).
Every value whithin the range will be serializable, any other will
result in "unknown". An integer value between two enum constants will
be (de)serialized as the nearest lower enum constant plus an offset.
For example, if the enum is defined as { value1 = 1, value2 = 5...,
unknown = 10 }, the available range would be from 1 to 9, and the
integer 4 will be serialized as "value1#3" which means (value1 + 3).

- Bit fields only allow combination of explicitely defined constants.
These will be (de)serialized as a combination of every defined enum
constants, any other value will be (de)serialized as "unknown". This
flavor restricts constants values to bitwise distinct integers, and to
values different from 0 in order to be able to decompose the enum into
the specified enum constants. 0 being the special "unknown" value for
this flavor.
For example, for an enum defined as { bit1 = 0b001, bit2 = 0b010,
bit3 = 0b100... }, an instance of this enum with an integer value of 3
will be serialized as "bit1+bit2", and "bit1+bit3" will be
deserialized as an enum instance of integer value 5.

I also did a package on mentors.debian.net if anybody is interested in
sponsoring it : http://mentors.debian.net/package/libtenum.

Best,
--
Beren Minor


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAONPvZx1C0rTZxy2MyyaRLEh2+jeZGSKx8Ji+57k2yO1OPj8X g@mail.gmail.com">http://lists.debian.org/CAONPvZx1C0rTZxy2MyyaRLEh2+jeZGSKx8Ji+57k2yO1OPj8X g@mail.gmail.com


All times are GMT. The time now is 02:40 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.