Commit 117faaa2 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère

Update README.md

parent 77d8e5e7
......@@ -3,31 +3,29 @@
QBind was developed to demonstrate the feasibility and advantages of a novel (de)serialization mechanism on top of
existing [Qt](http://qt.io) data formats (Settings, QDataStream, Json, Cbor, Xml) and generic data types (containers, QVariant, QMetaObject, etc.).
QBind requirements are convenient for most (de)serialization use cases but become necessary to analyse how software
is used in the field and diagnose complex issues:
**It would greatly simplify binding C++ data to Qt-supported [data formats](https://doc.qt.io/qt-5/topics-data-storage.html#)
or [data model](https://doc.qt.io/qt-5/model-view-programming.html) while providing more performance than traditional approaches.**
QBind requirements below are useful for most (de)serialization use cases. They would be mandatory to implement in Qt a tracing facility
allowing to analyse how software is used in the field and diagnose complex issues. Effectively:
- QDebug is conveniently used for debugging. But it may not be enough time- or space- efficient for running software
in the field, or require too much log parsing work to detect issues from multiple tracepoints or traces.
- LTTng/ETW (or Qt tracegen tool) allow analysing performance using a few statically-defined tracepoints with
high-performance and structured data. But analysing unexpected uses and issues in the field requires a lot more
tracepoints than can be conveniently defined statically.
Meeting **all** the requirements below strongly constrained QBind [design](design.md) that evolved in many versions
(from fully dynamic to fully static to a careful mix) before ending in a rather simple and general solution to the
(de)serialization problem.
**QBind would greatly simplify binding C++ data to Qt-supported [data formats](https://doc.qt.io/qt-5/topics-data-storage.html#)
or [data model](https://doc.qt.io/qt-5/model-view-programming.html) while providing more performance than traditional approaches.**
> **DISLAIMER** QBind is not currently unit-tested but provided with a [sample and benchmark](main.cpp).
> Also, the implementation is written in a concise style that supported the multiple refactorings but does not help explaining it.
> This is especially true for the various IBind implementations. The README and [design](design.md) documentation should be read
> before trying to understand the implementation.
See below:
See:
- [The requirements (read/write)](#the-requirements)
- [Some examples](#examples)
- [The results](#results)
- [Our conclusion](#conclusion)
- [The design](design.md)
> **DISLAIMER** It is not currently unit-tested but provided with a [sample and benchmark](main.cpp). Also, the
> implementation is written in a concise style that supported the multiple refactorings but does not help explaining it.
> This is especially true for the various IBind implementations.
> The README and [design](design.md) documentation should be read before trying to understand the implementation.
## The requirements
......@@ -41,7 +39,8 @@ See below:
2. most features of complex data (QCbor..., QXml..., QMetaObject, QModel...)
* **RW3. Allow optional metadata for complex formats** (CBOR tags, XML tags and attributes, QModel* columnNames, etc.)
* **RW4. No restriction on data size**
(some restrictions may apply with specific implementations that may, e.g. store context for each data structure levels, cache out-of-order data)
(some restrictions may apply with specific implementations that may, e.g. store context for each data structure levels,
cache out-of-order data, or even store all the data in memory)
### Write (serialization)
......@@ -116,6 +115,13 @@ struct Person
}
};
```
The value argument provides a fluent interface allowing to declaratively bind C++ data to a choice of:
* `sequence` of adjacent data items
* `record` of named data items
* Atomic values like `QString firstName`, `double height`, `int age`
* Generically supported T values for which a specialized QBind<T> is defined like `QVector<QString> phones`, `QList<E> children`
<details>
<summary>The same bind can read/write data in various formats with the same data (but varying metadata support)</summary>
......@@ -237,6 +243,7 @@ if (/*... &&*/
</details>
Defining a custom format for, say, console output only requires implementing a few `IWriter` abstract methods:
```cpp
class MyTextWriter : public IWriter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment