GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing cpp.libhunt.com — The IOD Library Alternatives - C++ Serialization | LibHunt The IOD LibraryMeta programming utilities for C++14. Merged in matt-42/lithium
Take the C++ Developer Survey
- About 6 minutes on the tools, libraries and AI you use with C++. You get the results by email.
Take the survey »
Popularity
4.6
Stable
Activity
0.0
Stable
Stars
725
Watchers
42
Forks
58
Last Commit
DescriptionThe IOD library enhances C++14 meta programming with compile-time reflexion on objects. It provides a compile-time a way to introspect objects and generate code matching their data structures.
Code Quality Rank:
L2
Programming language: C++
License: MIT License
Latest version: v1.0
The IOD Library alternatives and similar libraries
Based on the "Serialization" category.
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
Promo
www.saashub.com
* Code Quality Rankings and insights are calculated and provided by Lumnify.
Do you think we are missing an alternative of The IOD Library or a related project? READMEImportant NoteThis project has been refactored and renamed as the Lithium Libraries: https://github.com/matt-42/lithium The IOD LibraryThe IOD library enhances C++14 meta programming with a symbol based paradigm. It provides a compile-time way to introspect objects and generate code matching their data structures. It also contains few utilities built with symbol meta-programming. What is a IOD symbol?Symbols are at the core of the IOD paradigm. They add to C++ a missing powerful feature: The way to statically store in a variable the access to an object member, the call to a method, and the access to the string representing the name of this variable. Here is the most simple but powerful operator that is now possible with IOD symbols:
Without symbols (or other similar constructs), it is not possible to write such a generic print_member function. Without, one would have to write the three version accessing the three different members. By convention all the symbols start with the _[lowercase character]. And to avoid multiple definitions, guards should be used such as in the following:
The script Statically introspectable objects (SIO)Statically introspectable objects features are:
Command line parser.Iod provides an easy to use, type safe command line parser :
More example can be found in the test here: https://github.com/matt-42/iod/blob/master/tests/parse_command_line.cc A Fast, Malloc-Free Json Parser / Encoder.As of today, all json parsers rely upon dynamic data structures to parse and store the json objects. Even if some good parser reduces dramatically the amount of dynamic memory allocation, they still suffer from the dynamic paradigm: A single function has to handle the whole set of possible json objects. This comes to the absurd situation where a program handling a small set specific json object types have to use a json parser handling any kind of objects. The iod library implements the opposite approach: Using meta-programming and introspection, one tiny specialized json parser is generated for each SIO object type so it involves no dynamic memory allocation and very few conditional branching. It directly fills the object member according to their type without having to store the object in an intermediate hash map. This makes its performances impossible to match in other languages such as C or Java that do not provide static introspection. The encoder still needs optimizations, and the parser is currently from 1.3x to 2.3x faster than the RapidJSON library without explicit use of SIMD vector instructions. The only limitation of this design is when using a very large type set of json objects, the total code size of the generated parsers will be bigger than a generic dynamic parser. Note on memory allocation: While the parser does not allocate any intermediate structure, it allocates the destination object's members if they are of type std::vector or std::string.
Named Optional Function ArgumentsIn classic C++, you would define a function taking optional arguments as :
This has two drawbacks: First, it is not practical if the user needs to set the third optional argument, and oblige him to remember the place of each argument. SIOs are a good alternative since they solve both issues:
Foreach for tuple and SIOWhile C++11 introduce range based for loops for a container such as
std::vector, it does not provide a way to iterate on
tuples.
Furthermore, it automatically builds a new tuple if the given function returns a non void value:
Apply tuples and SIOs to functionsThe
C++ Embedded Domain Specific Languages FrameworkThe IOD library provides a set of tools to ease the embedding of an embedded domain specific languages (EDSL) framework. It includes an abstract syntax tree (AST) with symbols and values as terminals. Here is an example of a simple expression:
This code does nothing except computing the AST type and storing the
value 23. Language Integrated QueriesTo demonstrate the power of the IOD framework, we embedded an implementation of a subset of the SQL language in the C++ language. It handles SELECT, FROM, WHERE, INNER_JOIN (with the ON criteria), ORDER BY, GROUP BY, and aggregates such as average or sum. Given two collection:
The following requests are valid:
Compilers supportIOD relies on the C++14 standard. It has been successfully compiled with :
ContributingContributions or suggestions are welcome. Do not hesitate to fill issues, send pull requests, or discuss by email at [email protected]. Do not miss the trending, libraries, news and articles with our weekly report.
Spin The Wheel Of Names
for a cryptographically secure random name picker.
Schedule a when to meet poll. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |